fix corer case with utf8

SVN revision: 40867
This commit is contained in:
Carsten Haitzler 2009-05-31 21:26:36 +00:00
parent d8ae422259
commit 7c66538545
1 changed files with 10 additions and 6 deletions

View File

@ -1858,7 +1858,8 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
c->marginl - c->marginr)))
{
wrap = _layout_text_cutoff_get(c, fmt, it);
if (wrap == 0) wrap = 1;
if (wrap == 0)
evas_common_font_utf8_get_next((unsigned char *)str, &wrap);
if (wrap > 0)
{
if (fmt->wrap_word)
@ -1897,11 +1898,14 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
if (it->text) free(it->text);
_format_free(c->obj, it->format);
free(it);
it = (Evas_Object_Textblock_Item *)(EINA_INLIST_GET(c->ln->items))->last;
_layout_strip_trailing_whitespace(c, fmt, it);
twrap = _layout_word_end(str, wrap);
ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap);
str = str + twrap;
if (c->ln->items)
{
it = (Evas_Object_Textblock_Item *)(EINA_INLIST_GET(c->ln->items))->last;
_layout_strip_trailing_whitespace(c, fmt, it);
twrap = _layout_word_end(str, wrap);
ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap);
str = str + twrap;
}
}
}
}