fix some whitespace wrapping mojo

SVN revision: 16544
This commit is contained in:
Carsten Haitzler 2005-09-05 09:03:01 +00:00
parent 5250fbc7c8
commit ef551b1126
1 changed files with 13 additions and 11 deletions

View File

@ -1390,7 +1390,7 @@ _layout_strip_trailing_whitespace(Ctxt *c, Evas_Object_Textblock_Format *fmt, Ev
p = evas_common_font_utf8_get_last((unsigned char *)(it->text), strlen(it->text)); p = evas_common_font_utf8_get_last((unsigned char *)(it->text), strlen(it->text));
tp = p; tp = p;
if (p > 0) if (p >= 0)
/* while (p >= 0)*/ /* while (p >= 0)*/
{ {
chr = evas_common_font_utf8_get_prev((unsigned char *)(it->text), &p); chr = evas_common_font_utf8_get_prev((unsigned char *)(it->text), &p);
@ -1661,6 +1661,8 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
if (it->text) free(it->text); if (it->text) free(it->text);
_format_free(c->obj, it->format); _format_free(c->obj, it->format);
free(it); free(it);
it = (Evas_Object_Textblock_Item *)((Evas_Object_List *)c->ln->items)->last;
_layout_strip_trailing_whitespace(c, fmt, it);
twrap = _layout_word_end(str, wrap); twrap = _layout_word_end(str, wrap);
ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap); ch = evas_common_font_utf8_get_next((unsigned char *)str, &twrap);
str = str + twrap; str = str + twrap;
@ -1710,9 +1712,8 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
} }
else else
{ {
#if 1
/* wrap now is the index of the word START */ /* wrap now is the index of the word START */
if (wrap == 0)
{
index = wrap; index = wrap;
ch = evas_common_font_utf8_get_next((unsigned char *)str, &index); ch = evas_common_font_utf8_get_next((unsigned char *)str, &index);
if (!_is_white(ch) && if (!_is_white(ch) &&
@ -1721,7 +1722,6 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
_layout_walk_back_to_item_word_redo(c, it); _layout_walk_back_to_item_word_redo(c, it);
return; return;
} }
}
if (c->ln->items != NULL) if (c->ln->items != NULL)
{ {
white_stripped = _layout_item_abort(c, fmt, it); white_stripped = _layout_item_abort(c, fmt, it);
@ -1733,7 +1733,8 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
{ {
wrap = 0; wrap = 0;
twrap = _layout_word_end(it->text, wrap); twrap = _layout_word_end(it->text, wrap);
wrap = _layout_word_next(it->text, wrap); wrap = twrap;
ch = evas_common_font_utf8_get_next((unsigned char *)str, &wrap);
if (twrap >= 0) if (twrap >= 0)
_layout_item_text_cutoff(c, it, twrap); _layout_item_text_cutoff(c, it, twrap);
if (wrap > 0) if (wrap > 0)
@ -1745,6 +1746,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
str = NULL; str = NULL;
} }
} }
#endif
} }
else if (fmt->wrap_char) else if (fmt->wrap_char)
{ {