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
This commit is contained in:
Subodh Kumar 2015-08-04 15:32:47 +01:00 committed by Tom Hacohen
parent 667d7b15c9
commit 4284f11ca9
1 changed files with 24 additions and 3 deletions

View File

@ -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)
{