From: Subodh Kumar Date: Tue, 4 Aug 2015 14:32:47 +0000 (+0100) Subject: Edje entry: Make filter logic consistent across all input methods X-Git-Tag: v1.16.0-alpha1~388 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4284f11ca90af2764301365f3a6916ac43ac22f2;p=platform%2Fupstream%2Fefl.git 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 --- 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) {