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 <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9860
This commit is contained in:
Marcel Hollerbach 2019-09-06 13:55:28 +02:00
parent 588745e995
commit 9284418bea
1 changed files with 4 additions and 0 deletions

View File

@ -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;