summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongJong Lee <yj34.lee@samsung.com>2018-01-31 15:04:26 +0100
committerMarcel Hollerbach <marcel@osg.samsung.com>2018-01-31 15:04:26 +0100
commitd2df4b382f6ef20640f8872e6a354004ab611aae (patch)
tree7cc82ce0f08a4742c4928a3778c0ee592bbae0b3
parentf00000df5a2483eb669b52c6c30587c1b0a9078b (diff)
efl_ui_focus_parent_provider_gen: code refactoring
Summary: remove needless function call and else statement Reviewers: bu5hm4n Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5732
-rw-r--r--src/lib/elementary/efl_ui_focus_parent_provider_gen.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/lib/elementary/efl_ui_focus_parent_provider_gen.c b/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
index b5babe133c..807e67519c 100644
--- a/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
+++ b/src/lib/elementary/efl_ui_focus_parent_provider_gen.c
@@ -50,30 +50,25 @@ _efl_ui_focus_parent_provider_gen_efl_ui_focus_parent_provider_find_logical_pare
50{ 50{
51 //first check if this item is in the map 51 //first check if this item is in the map
52 Elm_Widget_Item *item, *above_gengrid = widget; 52 Elm_Widget_Item *item, *above_gengrid = widget;
53 Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget);
53 54
54 if (elm_widget_parent_widget_get(widget) != pd->container) 55 //move forward so we get the last widget above the gengrid level,
56 //this may be the widget out of the map
57 while (parent && parent != pd->container)
55 { 58 {
56 Efl_Ui_Widget *parent = elm_widget_parent_widget_get(widget); 59 above_gengrid = parent;
57 //move forward so we get the last widget above the gengrid level, this may be the widget out of the map 60 parent = elm_widget_parent_widget_get(above_gengrid);
58 do {
59 above_gengrid = parent;
60 parent = elm_widget_parent_widget_get(above_gengrid);
61 } while(parent && parent != pd->container);
62 } 61 }
63 62
64 item = eina_hash_find(pd->map, &above_gengrid); 63 item = eina_hash_find(pd->map, &above_gengrid);
65 64
66 efl_ui_focus_object_prepare_logical(pd->container); 65 efl_ui_focus_object_prepare_logical(pd->container);
67 66
67 if (item)
68 return item;
69
68 // We dont have a map entry 70 // We dont have a map entry
69 if (!item) 71 return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
70 {
71 return efl_ui_focus_parent_provider_find_logical_parent(pd->provider, widget);
72 }
73 else
74 {
75 return item;
76 }
77} 72}
78 73
79 74