Evas textblock: Fixed a bug in _paragraph_char_last with the last par.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 10 Jul 2011 13:22:33 +0000 (13:22 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 10 Jul 2011 13:22:33 +0000 (13:22 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61205 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index e5e6869..550a24b 100644 (file)
@@ -5667,7 +5667,12 @@ evas_textblock_cursor_paragraph_char_last(Evas_Textblock_Cursor *cur)
 
    if (!cur) return;
    if (!cur->node) return;
-   ind = eina_ustrbuf_length_get(cur->node->unicode) - 1;
+   ind = eina_ustrbuf_length_get(cur->node->unicode);
+   /* If it's not the last paragraph, go back one, because we want to point
+    * to the PS, not the NULL */
+   if (EINA_INLIST_GET(cur->node)->next)
+      ind--;
+
    if (ind >= 0)
       cur->pos = ind;
    else