This fixes a case with wrapping, where the text has a mixture of 'none'
and 'word' wrapping modes, and the layout function decides to
roll-back a few items.
The test case is added to the evas_suite.
This might not be a common case, or even a case we had defined a proper
behavior to, but since it causes an infinite loop, it needs to be fixed.
@fix
}
/* 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 ||
+ else if (((wrap > 0) || it->format->wrap_word || it->format->wrap_char ||
it->format->wrap_mixed) && it->text_node)
{
size_t line_start;
fail_if(w > h); /* FIXME: Not the best test, should be more strict. */
+ evas_object_textblock_text_markup_set(tb,
+ "<wrap=none>aaa bbbbbbbbbbb ccccc</wrap><wrap=word>dddddd</wrap>");
+ evas_object_textblock_size_native_get(tb, &nw, &nh);
+ evas_object_resize(tb, nw / 2, nh * 4);
+ evas_object_textblock_size_formatted_get(tb, &w, NULL);
+ ck_assert_int_le(w, nw);
+
END_TB_TEST();
}
END_TEST