tasn pushed a commit to branch efl-1.8. http://git.enlightenment.org/core/efl.git/commit/?id=225c3370bea4818ceecc538b2351b5f137ed294a
commit 225c3370bea4818ceecc538b2351b5f137ed294a Author: Youngbok Shin <youngb.s...@samsung.com> Date: Fri Dec 27 11:36:10 2013 +0000 Evas textblock: Fixed range_text_get bug with multiple text nodes. Summary: When there is multi text nodes for range text get, it gets wrong format node of last text node. It makes broken result. Test Plan: https://phab.enlightenment.org/D398 Reviewers: woohyun, tasn, seoz Reviewed By: tasn CC: cedric Differential Revision: https://phab.enlightenment.org/D399 --- src/lib/evas/canvas/evas_object_textblock.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 94070e8..0830a09 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -8924,26 +8924,18 @@ _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, { Evas_Object_Textblock_Node_Format *fnode; Eina_Unicode *text_base, *text; + int cur1_pos = 0, cur2_pos = -1; int off = 0; text_base = text = eina_unicode_strndup(eina_ustrbuf_string_get(tnode->unicode), eina_ustrbuf_length_get(tnode->unicode)); if (tnode == cur2->node) - { - fnode = _evas_textblock_node_text_get_first_format_between(tnode, - cur1->pos, cur2->pos); - } - else if (tnode == cur1->node) - { - fnode = _evas_textblock_node_text_get_first_format_between(tnode, - cur1->pos, -1); - } - else - { - fnode = _evas_textblock_node_text_get_first_format_between(tnode, - 0, -1); - } + cur2_pos = cur2->pos; + if (tnode == cur1->node) + cur1_pos = cur1->pos; + fnode = _evas_textblock_node_text_get_first_format_between(tnode, + cur1_pos, cur2_pos); /* Init the offset so the first one will count starting from cur1->pos * and not the previous format node */ if (tnode == cur1->node) --