From: arosis78 <35049857+arosis78@users.noreply.github.com> Date: Mon, 17 Dec 2018 07:46:11 +0000 (+0900) Subject: [ElmSharp] Fix crash issue for GetTextBlockGeometryByLineNumber() (#618) X-Git-Tag: 5.5_M2~369 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44b6671d35e3bcfe7e8c1eefc343f904d7bb3c16;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [ElmSharp] Fix crash issue for GetTextBlockGeometryByLineNumber() (#618) Signed-off-by: Jeonghyun Yun --- diff --git a/src/ElmSharp/ElmSharp/EvasObject.cs b/src/ElmSharp/ElmSharp/EvasObject.cs old mode 100644 new mode 100755 index 9a8f07a..1661184 --- a/src/ElmSharp/ElmSharp/EvasObject.cs +++ b/src/ElmSharp/ElmSharp/EvasObject.cs @@ -1081,12 +1081,26 @@ namespace ElmSharp /// y coordinate of the line. /// w coordinate of the line. /// h coordinate of the line. - /// + /// True on success, or False on error. /// preview [Obsolete("GetTextBlockGeometryByLineNumber is obsolete as of version 5.0.0.14299 and is no longer supported.")] public bool GetTextBlockGeometryByLineNumber(int lineNumber, out int x, out int y, out int w, out int h) { - return Interop.Evas.evas_object_textblock_line_number_geometry_get(RealHandle, lineNumber, out x, out y, out w, out h); + x = -1; y = -1; w = -1; h = -1; + + IntPtr _edjeHandle = Interop.Elementary.elm_layout_edje_get(RealHandle); + if (_edjeHandle == IntPtr.Zero) + { + return false; + } + + IntPtr _textblock = Interop.Elementary.edje_object_part_object_get(_edjeHandle, "elm.text"); + if (_textblock == IntPtr.Zero) + { + return false; + } + + return Interop.Evas.evas_object_textblock_line_number_geometry_get(_textblock, lineNumber, out x, out y, out w, out h); } internal IntPtr GetData(string key)