elementary/elm_entry.c : theme,changed smart callback can move the cursor position...
authorWooHyun Jung <wh0705.jung@samsung.com>
Mon, 21 Oct 2013 11:59:43 +0000 (20:59 +0900)
committerWooHyun Jung <wh0705.jung@samsung.com>
Mon, 21 Oct 2013 11:59:43 +0000 (20:59 +0900)
src/lib/elm_entry.c

index ed83299..088b2db 100644 (file)
@@ -521,14 +521,13 @@ _elm_entry_smart_theme(Eo *obj, void *_pd, va_list *list)
    edje_object_part_text_input_panel_return_key_disabled_set
      (sd->entry_edje, "elm.text", sd->input_panel_return_key_disabled);
 
+   // elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
+   // -> smart_objects_calculate will call all smart calculate functions,
+   // and one of them can delete elm_entry.
+   evas_object_ref(obj);
+
    if (sd->cursor_pos != 0)
-     {
-        // elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
-        // -> smart_objects_calculate will call all smart calculate functions,
-        // and one of them can delete elm_entry.
-        evas_object_ref(obj);
-        elm_entry_cursor_pos_set(obj, sd->cursor_pos);
-     }
+     elm_entry_cursor_pos_set(obj, sd->cursor_pos);
 
    if (elm_widget_focus_get(obj))
      edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
@@ -570,8 +569,7 @@ _elm_entry_smart_theme(Eo *obj, void *_pd, va_list *list)
 
    evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, NULL);
 
-   if (sd->cursor_pos != 0)
-     evas_object_unref(obj);
+   evas_object_unref(obj);
 
    if (ret) *ret = EINA_TRUE;
 }