summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-11-24 14:32:36 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 14:32:36 +0900
commit8f2369c5b6b756619f23cc96f312e4e97030ab7c (patch)
treefee7dce27d655ec35c6776473b6f789a752eb382
parent56abebf236d93a39547771f4bf6e0dae5abc575b (diff)
efl_ui_widget: secure elm_legacy_add flag
Summary: _elm_legacy_add goes back to EINA_FALSE after setting sd->legacy. if constructor get called again after going back to EINA_FALSE, sd->legacy should remain EINA_TRUE. also, elm_legacy_add() should not be called non-elm_widget. Test Plan: Run elementary test->Efl.Ui.Text.Label. Check legacy flag in _elm_theme_object_set() for efl_ui_win. Check legacy flag for efl_ui_text after scrollable text is added. Reviewers: jpeg, woohyun Reviewed By: jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5529
-rw-r--r--src/lib/elementary/elm_interface_scrollable.c2
-rw-r--r--src/lib/elementary/elm_widget.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c
index 8f1371f..522deba 100644
--- a/src/lib/elementary/elm_interface_scrollable.c
+++ b/src/lib/elementary/elm_interface_scrollable.c
@@ -192,7 +192,7 @@ _elm_pan_content_size_get(Eo *obj EINA_UNUSED, Elm_Pan_Smart_Data *psd, Evas_Coo
192static Evas_Object * 192static Evas_Object *
193_elm_pan_add(Evas *evas) 193_elm_pan_add(Evas *evas)
194{ 194{
195 return elm_legacy_add(MY_PAN_CLASS, evas); 195 return efl_add(MY_PAN_CLASS, evas, efl_canvas_object_legacy_ctor(efl_added));
196} 196}
197 197
198EOLIAN static Eo * 198EOLIAN static Eo *
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 3b122a9..5531bb7 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -5046,8 +5046,11 @@ _elm_widget_efl_object_constructor(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSE
5046 Eo *parent = NULL; 5046 Eo *parent = NULL;
5047 5047
5048 sd->on_create = EINA_TRUE; 5048 sd->on_create = EINA_TRUE;
5049 sd->legacy = _elm_legacy_add; 5049 if (_elm_legacy_add)
5050 _elm_legacy_add = EINA_FALSE; 5050 {
5051 sd->legacy = _elm_legacy_add;
5052 _elm_legacy_add = EINA_FALSE;
5053 }
5051 efl_canvas_group_clipped_set(obj, EINA_FALSE); 5054 efl_canvas_group_clipped_set(obj, EINA_FALSE);
5052 obj = efl_constructor(efl_super(obj, MY_CLASS)); 5055 obj = efl_constructor(efl_super(obj, MY_CLASS));
5053 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); 5056 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);