summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2015-08-27 18:20:47 +0300
committerDaniel Hirt <daniel.hirt@samsung.com>2015-08-30 11:07:26 +0300
commit6521c4128c9ec7015333e0c81487902e0ca7b4db (patch)
tree1285cf042362204edc22bcea2ede03feee7ac395
parent6bb6552d979bf3ecce7eba0a3505c877a1138bb2 (diff)
Evas textblock: fix case of own_closer in style_set
Looks like it was assumed that an fnode->orig_format always ends with a '/' character if the fnode is an own_closer. The problem is that a paragraph separator ("ps" and "br" - the latter in legacy newline mode) is also an own_closer, but might not have '/' at the end, so decrementing the length is wrong. This fixes T2654. The example markup had "br" read as "b", which led to a mismatch with the "font_weight=Bold" tag. Coincidentally, "ps" was not affected as there was no matching "p" in the style. @fix
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index d992cd626b..ce419c2423 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -6168,8 +6168,11 @@ _textblock_style_generic_set(Evas_Object *eo_obj, Evas_Textblock_Style *ts,
6168 size_t format_len = eina_stringshare_strlen(fnode->orig_format); 6168 size_t format_len = eina_stringshare_strlen(fnode->orig_format);
6169 /* Is this safe to use alloca here? Strings might possibly get large */ 6169 /* Is this safe to use alloca here? Strings might possibly get large */
6170 6170
6171 if (fnode->own_closer) 6171 if (fnode->own_closer &&
6172 format_len--; 6172 (format_len > 0) && (fnode->orig_format[format_len - 1] == '/'))
6173 {
6174 format_len--;
6175 }
6173 6176
6174 match = _textblock_format_node_from_style_tag(o, fnode, fnode->orig_format, 6177 match = _textblock_format_node_from_style_tag(o, fnode, fnode->orig_format,
6175 format_len); 6178 format_len);