From c9290ef41da6fa7beb054f48878b7089575fa557 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Thu, 7 Apr 2011 15:25:19 +0000 Subject: [PATCH] Evas textblock: Fix handling of newline in compatiblity mode. This fixes an issue with newlines that were shoved in the middle of other format parts like . SVN revision: 58457 --- legacy/evas/src/lib/canvas/evas_object_textblock.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index 58338b0c6b..9ac395d480 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -2994,11 +2994,7 @@ _layout_do_format(const Evas_Object *obj __UNUSED__, Ctxt *c, { Evas_Object_Textblock_Format_Item *fi; - /* If in compatible mode, insert a ps */ - if (c->o->newline_is_ps) - fi = _layout_format_item_add(c, n, "ps", fmt); - else - fi = _layout_format_item_add(c, n, item, fmt); + fi = _layout_format_item_add(c, n, item, fmt); fi->parent.w = fi->parent.adv = 0; } @@ -3416,7 +3412,12 @@ _layout_visualize_par(Ctxt *c) Evas_Object_Textblock_Format_Item *fi; fi = _ITEM_FORMAT(it); fi->y = c->y; - if (fi->item && _IS_LINE_SEPARATOR(fi->item)) + /* If it's a newline, and we are not in newline compat + * mode, or we are in newline compat mode, and this is + * not used as a paragraph separator, advance */ + if (fi->item && _IS_LINE_SEPARATOR(fi->item) && + (!c->o->newline_is_ps || + eina_list_next(i))) { adv_line = 1; }