summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubodh Kumar <s7158.kumar@samsung.com>2015-08-04 15:32:47 +0100
committerTom Hacohen <tom@stosb.com>2015-08-04 15:35:17 +0100
commit4284f11ca90af2764301365f3a6916ac43ac22f2 (patch)
tree8b08f12ae3829e73c92c8c174d5b90319b4e3f2c
parent667d7b15c9b7779e3cf5815ee062e47109077256 (diff)
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
-rw-r--r--src/lib/edje/edje_entry.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 4a57d566b0..eab317f028 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
207{ 207{
208 Edje_Markup_Filter_Callback *cb; 208 Edje_Markup_Filter_Callback *cb;
209 Eina_List *l; 209 Eina_List *l;
210 Eina_Bool have_sel = EINA_FALSE;
211
212 if ((clearsel) && (en->have_selection))
213 {
214 _range_del_emit(ed, en->cursor, en->rp->object, en);
215 have_sel = EINA_TRUE;
216 }
210 217
211 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) 218 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb)
212 { 219 {
@@ -238,10 +245,12 @@ _text_filter_markup_prepend_internal(Edje *ed, Entry *en, Evas_Textblock_Cursor
238 eina_unicode_utf8_get_len(info->change.insert.content); 245 eina_unicode_utf8_get_len(info->change.insert.content);
239 } 246 }
240 } 247 }
241 if ((clearsel) && (en->have_selection)) 248 if (have_sel)
242 { 249 {
243 _range_del_emit(ed, en->cursor, en->rp->object, en); 250 if (info)
244 if (info) info->merge = EINA_TRUE; 251 {
252 info->merge = EINA_TRUE;
253 }
245 } 254 }
246 if (info) 255 if (info)
247 info->change.insert.pos = 256 info->change.insert.pos =
@@ -266,6 +275,12 @@ _text_filter_text_prepend(Edje *ed, Entry *en, Evas_Textblock_Cursor *c,
266 Eina_List *l; 275 Eina_List *l;
267 276
268 EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); 277 EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
278
279 if ((clearsel) && (en->have_selection))
280 {
281 _range_del_emit(ed, en->cursor, en->rp->object, en);
282 }
283
269 text2 = strdup(text); 284 text2 = strdup(text);
270 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) 285 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
271 { 286 {
@@ -383,6 +398,12 @@ _text_filter_markup_prepend(Edje *ed, Entry *en, Evas_Textblock_Cursor *c,
383 Eina_List *l; 398 Eina_List *l;
384 399
385 EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); 400 EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL);
401
402 if ((clearsel) && (en->have_selection))
403 {
404 _range_del_emit(ed, en->cursor, en->rp->object, en);
405 }
406
386 text2 = strdup(text); 407 text2 = strdup(text);
387 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) 408 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
388 { 409 {