diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2015-05-29 13:16:49 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2015-05-29 15:07:46 +0900 |
commit | 196e9092758150361556cfd2cf29013fc178ca3b (patch) | |
tree | ab829d0b58b9e4f8d50e1b8cfcb1ac3c2737b160 | |
parent | 52d998f475afd1a8cb18e5990aafd7f1c2b5c41e (diff) |
Fix issue wrong surrounding text returns when there is selection area
@fix
Change-Id: Iff89b396c1a69d2879b9f710eb41e58e9d377b87
-rw-r--r-- | src/lib/edje/edje_entry.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 1f4fadbd21..c088610dd1 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c | |||
@@ -4014,7 +4014,6 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_ | |||
4014 | Entry *en = NULL; | 4014 | Entry *en = NULL; |
4015 | const char *str; | 4015 | const char *str; |
4016 | char *plain_text; | 4016 | char *plain_text; |
4017 | Eina_Strbuf *buf = NULL; | ||
4018 | 4017 | ||
4019 | if (!rp) return EINA_FALSE; | 4018 | if (!rp) return EINA_FALSE; |
4020 | if ((rp->type != EDJE_RP_TYPE_TEXT) || | 4019 | if ((rp->type != EDJE_RP_TYPE_TEXT) || |
@@ -4034,20 +4033,7 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_ | |||
4034 | 4033 | ||
4035 | if (plain_text) | 4034 | if (plain_text) |
4036 | { | 4035 | { |
4037 | if (en->have_selection) | 4036 | *text = strdup(plain_text); |
4038 | { | ||
4039 | buf = eina_strbuf_new(); | ||
4040 | |||
4041 | if (en->sel_start) | ||
4042 | eina_strbuf_append_n(buf, plain_text, evas_textblock_cursor_pos_get(en->sel_start)); | ||
4043 | else | ||
4044 | eina_strbuf_append(buf, plain_text); | ||
4045 | |||
4046 | *text = strdup(eina_strbuf_string_get(buf)); | ||
4047 | eina_strbuf_free(buf); | ||
4048 | } | ||
4049 | else | ||
4050 | *text = strdup(plain_text); | ||
4051 | 4037 | ||
4052 | free(plain_text); | 4038 | free(plain_text); |
4053 | plain_text = NULL; | 4039 | plain_text = NULL; |
@@ -4061,9 +4047,7 @@ _edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_ | |||
4061 | 4047 | ||
4062 | if (cursor_pos) | 4048 | if (cursor_pos) |
4063 | { | 4049 | { |
4064 | if (en->have_selection && en->sel_start) | 4050 | if (en->cursor) |
4065 | *cursor_pos = evas_textblock_cursor_pos_get(en->sel_start); | ||
4066 | else if (en->cursor) | ||
4067 | *cursor_pos = evas_textblock_cursor_pos_get(en->cursor); | 4051 | *cursor_pos = evas_textblock_cursor_pos_get(en->cursor); |
4068 | else | 4052 | else |
4069 | *cursor_pos = 0; | 4053 | *cursor_pos = 0; |