Fix issue wrong surrounding text returns when there is selection area

@fix

Change-Id: Iff89b396c1a69d2879b9f710eb41e58e9d377b87
This commit is contained in:
Jihoon Kim 2015-05-29 13:16:49 +09:00
parent 52d998f475
commit 196e909275
1 changed files with 2 additions and 18 deletions

View File

@ -4014,7 +4014,6 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_
Entry *en = NULL;
const char *str;
char *plain_text;
Eina_Strbuf *buf = NULL;
if (!rp) return EINA_FALSE;
if ((rp->type != EDJE_RP_TYPE_TEXT) ||
@ -4034,20 +4033,7 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_
if (plain_text)
{
if (en->have_selection)
{
buf = eina_strbuf_new();
if (en->sel_start)
eina_strbuf_append_n(buf, plain_text, evas_textblock_cursor_pos_get(en->sel_start));
else
eina_strbuf_append(buf, plain_text);
*text = strdup(eina_strbuf_string_get(buf));
eina_strbuf_free(buf);
}
else
*text = strdup(plain_text);
*text = strdup(plain_text);
free(plain_text);
plain_text = NULL;
@ -4061,9 +4047,7 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_
if (cursor_pos)
{
if (en->have_selection && en->sel_start)
*cursor_pos = evas_textblock_cursor_pos_get(en->sel_start);
else if (en->cursor)
if (en->cursor)
*cursor_pos = evas_textblock_cursor_pos_get(en->cursor);
else
*cursor_pos = 0;