summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-06 13:58:19 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-09-06 16:20:35 +0200
commitfcd3d82c101e3e10c4f2dd816b1db645e7b919d6 (patch)
tree20a4d93efd3c77b28aff68b6a5e47c5a22279325
parent9284418bea8debf33024cce88c971c02c518b4b6 (diff)
efl_ui_spotlight: do not perform insertion if existing is not added
same as the previous commit, just for spotlight. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9861
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 9b7737415f..50a8e9a014 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -316,9 +316,10 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_before(Eo *obj EINA_UNUSED,
316 Efl_Gfx_Entity *subobj, 316 Efl_Gfx_Entity *subobj,
317 const Efl_Gfx_Entity *existing) 317 const Efl_Gfx_Entity *existing)
318{ 318{
319 if (!_register_child(obj, pd, subobj)) return EINA_FALSE;
320 int index = eina_list_data_idx(pd->content_list, (void *)existing); 319 int index = eina_list_data_idx(pd->content_list, (void *)existing);
321 if (index == -1) return EINA_FALSE; 320 EINA_SAFETY_ON_FALSE_RETURN_VAL(index >= 0, EINA_FALSE);
321
322 if (!_register_child(obj, pd, subobj)) return EINA_FALSE;
322 pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing); 323 pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing);
323 _update_internals(obj, pd, subobj, index); 324 _update_internals(obj, pd, subobj, index);
324 return EINA_TRUE; 325 return EINA_TRUE;
@@ -330,9 +331,10 @@ _efl_ui_spotlight_container_efl_pack_linear_pack_after(Eo *obj EINA_UNUSED,
330 Efl_Gfx_Entity *subobj, 331 Efl_Gfx_Entity *subobj,
331 const Efl_Gfx_Entity *existing) 332 const Efl_Gfx_Entity *existing)
332{ 333{
333 if (!_register_child(obj, pd, subobj)) return EINA_FALSE;
334 int index = eina_list_data_idx(pd->content_list, (void *)existing); 334 int index = eina_list_data_idx(pd->content_list, (void *)existing);
335 if (index == -1) return EINA_FALSE; 335 EINA_SAFETY_ON_FALSE_RETURN_VAL(index >= 0, EINA_FALSE);
336
337 if (!_register_child(obj, pd, subobj)) return EINA_FALSE;
336 pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing); 338 pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing);
337 _update_internals(obj, pd, subobj, index + 1); 339 _update_internals(obj, pd, subobj, index + 1);
338 return EINA_TRUE; 340 return EINA_TRUE;