summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-01 14:45:19 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-17 15:21:10 +0200
commitb0549bb8cccead28182ed89dd63598e547032075 (patch)
treedc78e68e128581b96932beee4fa9d4f1017ec99a
parentadc51e882c5e57d5b38c58541d6e9f57a181c4be (diff)
efl_ui_box: print more errors,
when a element is added two times, we should print an error. Same for removing a child that is not part of this container. Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D8522
-rw-r--r--src/lib/elementary/efl_ui_box.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c
index 5e33ed8602..dbe9991cd8 100644
--- a/src/lib/elementary/efl_ui_box.c
+++ b/src/lib/elementary/efl_ui_box.c
@@ -47,7 +47,10 @@ static inline Eina_Bool
47_efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) 47_efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj)
48{ 48{
49 if (!subobj || (efl_canvas_object_render_parent_get(subobj) == obj)) 49 if (!subobj || (efl_canvas_object_render_parent_get(subobj) == obj))
50 return EINA_FALSE; 50 {
51 ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj) );
52 return EINA_FALSE;
53 }
51 54
52 if (!efl_ui_widget_sub_object_add(obj, subobj)) 55 if (!efl_ui_widget_sub_object_add(obj, subobj))
53 return EINA_FALSE; 56 return EINA_FALSE;
@@ -66,6 +69,11 @@ _efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj)
66static inline Eina_Bool 69static inline Eina_Bool
67_efl_ui_box_child_unregister(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) 70_efl_ui_box_child_unregister(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj)
68{ 71{
72 if (efl_canvas_object_render_parent_get(subobj) != obj)
73 {
74 ERR("subobj %p %s is not part of this widget", subobj, efl_class_name_get(subobj) );
75 return EINA_FALSE;
76 }
69 if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj)) 77 if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj))
70 return EINA_FALSE; 78 return EINA_FALSE;
71 79