From f0846b8df46f687e987ac2f373c3a7f565bcbbef Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 1 Apr 2019 14:45:19 +0200 Subject: [PATCH] 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 Differential Revision: https://phab.enlightenment.org/D8522 --- src/lib/elementary/efl_ui_box.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 91cdb59..ac5e8e0 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 _efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) { if (!subobj || (efl_canvas_object_render_parent_get(subobj) == obj)) - return EINA_FALSE; + { + ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj) ); + return EINA_FALSE; + } if (!efl_ui_widget_sub_object_add(obj, subobj)) return EINA_FALSE; @@ -66,6 +69,11 @@ _efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) static inline Eina_Bool _efl_ui_box_child_unregister(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) { + if (efl_canvas_object_render_parent_get(subobj) != obj) + { + ERR("subobj %p %s is not part of this widget", subobj, efl_class_name_get(subobj) ); + return EINA_FALSE; + } if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj)) return EINA_FALSE; -- 2.7.4