bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9284418bea8debf33024cce88c971c02c518b4b6

commit 9284418bea8debf33024cce88c971c02c518b4b6
Author: Marcel Hollerbach <[email protected]>
Date:   Fri Sep 6 13:55:28 2019 +0200

    efl_ui_box: do not perform insertion if existing is not added
    
    this was brought up recently and it is true that this should be fixed.
    If existing is not registered in the container, then we should not
    perform the operation at all.
    
    Reviewed-by: Mike Blumenkrantz <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D9860
---
 src/lib/elementary/efl_ui_box.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c
index 58b77f1d40..04533f997e 100644
--- a/src/lib/elementary/efl_ui_box.c
+++ b/src/lib/elementary/efl_ui_box.c
@@ -282,6 +282,8 @@ _efl_ui_box_efl_pack_linear_pack_begin(Eo *obj, 
Efl_Ui_Box_Data *pd, Efl_Gfx_Ent
 EOLIAN static Eina_Bool
 _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Box_Data *pd, 
Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
 {
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, 
existing), EINA_FALSE);
+
    if (!_efl_ui_box_child_register(obj, pd, subobj))
      return EINA_FALSE;
 
@@ -293,6 +295,8 @@ _efl_ui_box_efl_pack_linear_pack_before(Eo *obj, 
Efl_Ui_Box_Data *pd, Efl_Gfx_En
 EOLIAN static Eina_Bool
 _efl_ui_box_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Box_Data *pd, 
Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing)
 {
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_list_data_find(pd->children, 
existing), EINA_FALSE);
+
    if (!_efl_ui_box_child_register(obj, pd, subobj))
      return EINA_FALSE;
 

-- 


Reply via email to