forked from enlightenment/efl
evas: text_cursor: check return value and print error
Make sure we check the return of evas_textblock_cursor_geometry_bidi_get() and print an error if needed. CID:1425191 Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11707
This commit is contained in:
parent
51e4bcc32c
commit
c6df676a70
|
@ -75,8 +75,10 @@ EOLIAN static Eina_Rect
|
||||||
_efl_text_cursor_object_cursor_geometry_get(const Eo *obj EINA_UNUSED, Efl_Text_Cursor_Object_Data *pd, Efl_Text_Cursor_Type ctype)
|
_efl_text_cursor_object_cursor_geometry_get(const Eo *obj EINA_UNUSED, Efl_Text_Cursor_Object_Data *pd, Efl_Text_Cursor_Type ctype)
|
||||||
{
|
{
|
||||||
Eina_Rect rc = {0};
|
Eina_Rect rc = {0};
|
||||||
|
Eina_Bool b_ret;
|
||||||
Evas_Textblock_Cursor_Type cursor_type = (ctype == EFL_TEXT_CURSOR_TYPE_BEFORE) ? EVAS_TEXTBLOCK_CURSOR_BEFORE : EVAS_TEXTBLOCK_CURSOR_UNDER;
|
Evas_Textblock_Cursor_Type cursor_type = (ctype == EFL_TEXT_CURSOR_TYPE_BEFORE) ? EVAS_TEXTBLOCK_CURSOR_BEFORE : EVAS_TEXTBLOCK_CURSOR_UNDER;
|
||||||
evas_textblock_cursor_geometry_bidi_get(pd->handle, &rc.x, &rc.y, &rc.w, &rc.h, NULL, NULL, NULL, NULL, cursor_type);
|
b_ret = evas_textblock_cursor_geometry_bidi_get(pd->handle, &rc.x, &rc.y, &rc.w, &rc.h, NULL, NULL, NULL, NULL, cursor_type);
|
||||||
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(b_ret, EINA_RECT_EMPTY());
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue