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
This commit is contained in:
Tom Hacohen 2011-05-06 10:00:21 +00:00
parent a68c149866
commit 2d0304019d
1 changed files with 5 additions and 5 deletions

View File

@ -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(