tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4284f11ca90af2764301365f3a6916ac43ac22f2

commit 4284f11ca90af2764301365f3a6916ac43ac22f2
Author: Subodh Kumar <s7158.ku...@samsung.com>
Date:   Tue Aug 4 15:32:47 2015 +0100

    Edje entry: Make filter logic consistent across all input methods
    
    Summary:
    When commit string comes from key_down text filter is applied before 
deleting
    the range but when commit string comes from imf filter is applied after 
deleting
    the range. Moreover when format is prepended range is deleted before 
applying
    insert filter. Please check the _edje_key_down_cb and
    _edje_entry_imf_event_commit_cb  routines.
    
    @fix
    
    Test Plan: Tested in Tizen device
    
    Reviewers: herdsman, thiepha, shilpasingh, raster, tasn
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D2904
---
 src/lib/edje/edje_entry.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 4a57d56..eab317f 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -207,6 +207,13 @@ _text_filter_markup_prepend_internal(Edje *ed, Entry *en, 
Evas_Textblock_Cursor
 {
    Edje_Markup_Filter_Callback *cb;
    Eina_List *l;
+   Eina_Bool have_sel = EINA_FALSE;
+
+   if ((clearsel) && (en->have_selection))
+     {
+        _range_del_emit(ed, en->cursor, en->rp->object, en);
+        have_sel = EINA_TRUE;
+     }
 
    EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb)
      {
@@ -238,10 +245,12 @@ _text_filter_markup_prepend_internal(Edje *ed, Entry *en, 
Evas_Textblock_Cursor
                     eina_unicode_utf8_get_len(info->change.insert.content);
                }
           }
-        if ((clearsel) && (en->have_selection))
+        if (have_sel)
           {
-             _range_del_emit(ed, en->cursor, en->rp->object, en);
-             if (info) info->merge = EINA_TRUE;
+            if (info)
+              {
+                 info->merge = EINA_TRUE;
+              }
           }
         if (info)
           info->change.insert.pos =
@@ -266,6 +275,12 @@ _text_filter_text_prepend(Edje *ed, Entry *en, 
Evas_Textblock_Cursor *c,
    Eina_List *l;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
+
+   if ((clearsel) && (en->have_selection))
+     {
+        _range_del_emit(ed, en->cursor, en->rp->object, en);
+     }
+
    text2 = strdup(text);
    EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
      {
@@ -383,6 +398,12 @@ _text_filter_markup_prepend(Edje *ed, Entry *en, 
Evas_Textblock_Cursor *c,
    Eina_List *l;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
+
+   if ((clearsel) && (en->have_selection))
+     {
+        _range_del_emit(ed, en->cursor, en->rp->object, en);
+     }
+
    text2 = strdup(text);
    EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
      {

-- 


Reply via email to