From c4d67e6289fd7f8d702b78d4658e34db34e94019 Mon Sep 17 00:00:00 2001 From: tasn Date: Mon, 11 Jul 2011 08:56:17 +0000 Subject: [PATCH] Evas textblock: Fixed evas_textblock_cursor_format_prev. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61232 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index dcd461d..0213923 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -5565,17 +5565,16 @@ evas_textblock_cursor_format_next(Evas_Textblock_Cursor *cur) EAPI Eina_Bool evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) { - Evas_Object_Textblock_Node_Format *node; + const Evas_Object_Textblock_Node_Format *node; if (!cur) return EINA_FALSE; if (!cur->node) return EINA_FALSE; - /* If the current node is a format node, just get the next if any, - * if it's a text, get the current format node out of the text and return - * the next format node if any. */ - node = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur); - if (evas_textblock_cursor_is_format(cur)) + node = evas_textblock_cursor_format_get(cur); + if (!node) { + node = _evas_textblock_cursor_node_format_before_or_at_pos_get(cur); if (node) { + cur->node = node->text_node; cur->pos = _evas_textblock_node_format_pos_get(node); return EINA_TRUE; @@ -5590,7 +5589,7 @@ evas_textblock_cursor_format_prev(Evas_Textblock_Cursor *cur) if (pnode) { cur->node = pnode->text_node; - cur->pos = _evas_textblock_node_format_pos_get(node); + cur->pos = _evas_textblock_node_format_pos_get(pnode); return EINA_TRUE; } -- 2.7.4