From 197ff820531d7d39749da2383f314b2b8e6b4232 Mon Sep 17 00:00:00 2001 From: tasn Date: Sun, 24 Jul 2011 08:50:42 +0000 Subject: [PATCH] Evas textblock: Fixed updating of formats position on char_delete. Format offsets got wrong when merging paragraphs. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61638 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_object_textblock.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index f8a68db..a74a818 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -6924,6 +6924,7 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) /* Remove a format node if needed, and remove the char only if the * fmt node is not visible */ { + Eina_Bool should_merge = EINA_FALSE; Evas_Object_Textblock_Node_Format *fmt, *fmt2; fmt = _evas_textblock_cursor_node_format_at_pos_get(cur); if (fmt) @@ -6937,7 +6938,7 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) { /* If it was a paragraph separator, we should merge the * current with the next, there must be a next. */ - _evas_textblock_cursor_nodes_merge(cur); + should_merge = EINA_TRUE; } /* If a singnular, mark as invisible, so we'll delete it. */ if (!format || ((*format != '+') && (*format != '-'))) @@ -6951,6 +6952,11 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur) _evas_textblock_node_format_adjust_offset(o, cur->node, fmt2, -(ind - cur->pos)); + if (should_merge) + { + _evas_textblock_cursor_nodes_merge(cur); + } + _evas_textblock_node_format_remove_matching(o, fmt); } -- 2.7.4