summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubodh Kumar <s7158.kumar@samsung.com>2016-08-29 17:23:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-08-29 17:26:40 +0900
commit0f4cdf7a486803cbef1b214b3ad86ef80176dccb (patch)
tree716c3f19101c1fd7586cd7a61fd4babb09195d56
parenta9fbe6cb8f35e00bb9ab4bca2873c13501a60697 (diff)
Edje entry: Pass correct cursor position and text to imf in case of selection
Summary: When selection is there we are passing the whole text and position to imf which sees that next character like matras (eg .Hindi) should be inserted (if pressed) and when matra comes the selected text is gone and only matra remains in the entry. eg: we have text in hindi like मानक, select all and hit matra in keyboard selected text is gone, only matra is there. @fix Test Plan: Tested in Tizen device Reviewers: jihoon, tasn, herdsman, thiepha Subscribers: Hermet, shilpasingh, raster, subodh, jpeg, cedric Differential Revision: https://phab.enlightenment.org/D2951
-rw-r--r--src/lib/edje/edje_entry.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index dae01925f3..f67d1317cd 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -4417,22 +4417,42 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_
4417 for (itr = plain_text; itr && *itr; ++itr) 4417 for (itr = plain_text; itr && *itr; ++itr)
4418 *itr = '*'; 4418 *itr = '*';
4419 } 4419 }
4420 4420 if (en->have_selection)
4421 *text = strdup(plain_text); 4421 {
4422 if (en->sel_start)
4423 {
4424 *text = strndup(plain_text,
4425 evas_textblock_cursor_pos_get(en->sel_start));
4426 }
4427 else
4428 {
4429 *text = strdup(plain_text);
4430 }
4431 }
4432 else
4433 {
4434 *text = strdup(plain_text);
4435 }
4422 4436
4423 free(plain_text); 4437 free(plain_text);
4424 plain_text = NULL; 4438 plain_text = NULL;
4425 } 4439 }
4426 else 4440 else
4427 *text = strdup(""); 4441 {
4442 *text = strdup("");
4443 }
4428 } 4444 }
4429 else 4445 else
4430 *text = strdup(""); 4446 {
4447 *text = strdup("");
4448 }
4431 } 4449 }
4432 4450
4433 if (cursor_pos) 4451 if (cursor_pos)
4434 { 4452 {
4435 if (en->cursor) 4453 if (en->have_selection && en->sel_start)
4454 *cursor_pos = evas_textblock_cursor_pos_get(en->sel_start);
4455 else if (en->cursor)
4436 *cursor_pos = evas_textblock_cursor_pos_get(en->cursor); 4456 *cursor_pos = evas_textblock_cursor_pos_get(en->cursor);
4437 else 4457 else
4438 *cursor_pos = 0; 4458 *cursor_pos = 0;