From b41fb87b5fe6375a484099b31faeb6b5f5bc1da9 Mon Sep 17 00:00:00 2001 From: tasn Date: Sun, 5 Sep 2010 08:29:52 +0000 Subject: [PATCH] Edje entry: started using the new evas_textblock_cursor_content_get. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@51899 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/edje_entry.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c index 5175089..0a92ff5 100644 --- a/src/lib/edje_entry.c +++ b/src/lib/edje_entry.c @@ -2438,25 +2438,17 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) const char * _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) { + static char *s = NULL; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); - const char *s; - static char buf[16]; - int pos, pos2, i; - if (!c) return NULL; - s = evas_textblock_node_format_text_get(evas_textblock_cursor_format_get(c)); - if (s) return s; - s = evas_textblock_cursor_paragraph_text_get(c); - if (!s) return NULL; - pos = evas_textblock_cursor_pos_get(c); - /* Get the actual utf8 pos */ - for (i = 0 ; pos > 0 ; pos--) - { - i = evas_string_char_next_get(s, i, NULL); - } - pos2 = evas_string_char_next_get(s, i, NULL); - strncpy(buf, s + i, pos2 - i); - buf[pos2 - i] = 0; - return buf; + + if (s) + { + free(s); + s = NULL; + } + + s = evas_textblock_cursor_content_get(c); + return s; } #ifdef HAVE_ECORE_IMF -- 2.7.4