From: Tom Hacohen Date: Fri, 6 May 2011 10:00:21 +0000 (+0000) Subject: Evas textblock: Fix seg with empty textblocks that cause wrapping. X-Git-Tag: submit/devel/efl/20131022.203902~9644 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d0304019dac96a3b2c780e8526f752efccbd6b1;p=platform%2Fupstream%2Fefl.git Evas textblock: Fix seg with empty textblocks that cause wrapping. Revert "evas: don't assume anymore that text_node is != NULL." This reverts commit 59231 Thanks to cedric for the report + initial fix. SVN revision: 59237 --- diff --git a/legacy/evas/src/lib/canvas/evas_object_textblock.c b/legacy/evas/src/lib/canvas/evas_object_textblock.c index 08535ca..b688c42 100644 --- a/legacy/evas/src/lib/canvas/evas_object_textblock.c +++ b/legacy/evas/src/lib/canvas/evas_object_textblock.c @@ -3162,7 +3162,6 @@ _layout_get_wordwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, const Evas_Object_Textblock_Text_Item *ti, size_t line_start, const char *breaks) { - if (!ti->parent.text_node) return -1; return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_FALSE, line_start, breaks); } @@ -3173,7 +3172,6 @@ _layout_get_mixedwrap(Ctxt *c, Evas_Object_Textblock_Format *fmt, const Evas_Object_Textblock_Text_Item *ti, size_t line_start, const char *breaks) { - if (!ti->parent.text_node) return -1; return _layout_get_word_mixwrap_common(c, fmt, ti, EINA_TRUE, line_start, breaks); } @@ -3381,8 +3379,10 @@ _layout_visualize_par(Ctxt *c) ret = 1; goto end; } - else if (it->format->wrap_word || it->format->wrap_char || - it->format->wrap_mixed) + /* If we want to wrap and it's worth checking for wrapping + * (i.e there's actually text). */ + else if ((it->format->wrap_word || it->format->wrap_char || + it->format->wrap_mixed) && it->text_node) { if (it->type == EVAS_TEXTBLOCK_ITEM_FORMAT) { @@ -3405,7 +3405,7 @@ _layout_visualize_par(Ctxt *c) if (!line_breaks) { /* Only relevant in those cases */ - if ((it->format->wrap_word || it->format->wrap_mixed) && it->text_node) + if (it->format->wrap_word || it->format->wrap_mixed) { size_t len = eina_ustrbuf_length_get(