Evas textblock: Fixed evas_textblock_cursor_format_prev.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Jul 2011 08:56:17 +0000 (08:56 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Jul 2011 08:56:17 +0000 (08:56 +0000)
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

index dcd461d..0213923 100644 (file)
@@ -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;
           }