From d30603e37f4de1545d9ab6a7c3311809e34469e7 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 10 Jul 2011 13:22:33 +0000 Subject: [PATCH] Evas textblock: Fixed a bug in _paragraph_char_last with the last par. SVN revision: 61205 --- legacy/evas/src/lib/canvas/evas_object_textblock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index e5e6869aed..550a24bd8a 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -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