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:
Ali Alzyod 2020-04-15 07:58:17 +00:00 committed by Stefan Schmidt
parent 51e4bcc32c
commit c6df676a70
1 changed files with 3 additions and 1 deletions

View File

@ -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)
{
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_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;
}