forked from enlightenment/efl
efl.text: add null check for cursor and attribute internal methods
Reviewers: woohyun, segfaultxavi, bu5hm4n, zmike Reviewed By: bu5hm4n Subscribers: ProhtMeyhet, cedric, #reviewers, #committers Tags: #efl Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10899
This commit is contained in:
parent
4e6fd08306
commit
87e5907f18
|
@ -246,7 +246,8 @@ _cursor_text_append(Efl_Text_Cursor_Handle *cur,
|
||||||
const char *off = text;
|
const char *off = text;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
|
Evas_Object_Protected_Data *obj = efl_data_scope_safe_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
|
||||||
evas_object_async_block(obj);
|
evas_object_async_block(obj);
|
||||||
|
|
||||||
while (*off)
|
while (*off)
|
||||||
|
@ -412,7 +413,8 @@ _efl_text_cursor_range_delete(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl
|
||||||
EAPI void
|
EAPI void
|
||||||
efl_text_cursor_handle_set(Eo *obj, Efl_Text_Cursor_Handle *handle)
|
efl_text_cursor_handle_set(Eo *obj, Efl_Text_Cursor_Handle *handle)
|
||||||
{
|
{
|
||||||
Efl_Text_Cursor_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
Efl_Text_Cursor_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(pd);
|
||||||
if (handle == pd->handle)
|
if (handle == pd->handle)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -429,7 +431,8 @@ efl_text_cursor_handle_set(Eo *obj, Efl_Text_Cursor_Handle *handle)
|
||||||
EAPI Efl_Text_Cursor_Handle *
|
EAPI Efl_Text_Cursor_Handle *
|
||||||
efl_text_cursor_handle_get(const Eo *obj)
|
efl_text_cursor_handle_get(const Eo *obj)
|
||||||
{
|
{
|
||||||
Efl_Text_Cursor_Data *pd = efl_data_scope_get(obj, MY_CLASS);
|
Efl_Text_Cursor_Data *pd = efl_data_scope_safe_get(obj, MY_CLASS);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(pd, NULL);
|
||||||
return pd->handle;
|
return pd->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,8 @@ efl_text_formatter_item_geometry_get(const Efl_Text_Attribute_Handle *annotation
|
||||||
Efl_Text_Cursor_Handle cur;
|
Efl_Text_Cursor_Handle cur;
|
||||||
|
|
||||||
Eo *eo_obj = annotation->obj;
|
Eo *eo_obj = annotation->obj;
|
||||||
Evas_Object_Protected_Data *obj_data = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
Evas_Object_Protected_Data *obj_data = efl_data_scope_safe_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN_VAL(obj_data, EINA_FALSE);
|
||||||
evas_object_async_block(obj_data);
|
evas_object_async_block(obj_data);
|
||||||
_evas_textblock_relayout_if_needed(eo_obj);
|
_evas_textblock_relayout_if_needed(eo_obj);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue