Evas: Each paragraph has at least one layout item in order to mark it's existence.

SVN revision: 51039
This commit is contained in:
Tom Hacohen 2010-08-12 14:20:19 +00:00
parent d2988fe707
commit d8fadf706b
1 changed files with 11 additions and 5 deletions

View File

@ -2396,6 +2396,7 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
else else
{ {
int len; int len;
int orig_off = off;
len = eina_ustrbuf_length_get(n->unicode); len = eina_ustrbuf_length_get(n->unicode);
if (off == 0) return; if (off == 0) return;
else if (off < 0) off = len - start; else if (off < 0) off = len - start;
@ -2404,6 +2405,13 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
{ {
start = 0; start = 0;
} }
else if ((start == 0) && (off == 0) && (orig_off == -1))
{
/* Special case that means that we need to add an empty
* item */
str = EINA_UNICODE_EMPTY_STRING;
goto skip;
}
else if ((start >= len) || (off > len)) else if ((start >= len) || (off > len))
{ {
return; return;
@ -2415,13 +2423,11 @@ _layout_text_append(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Text
{ {
alloc_str[off] = 0; alloc_str[off] = 0;
} }
tbase = str = alloc_str; str = alloc_str;
} }
} }
else skip:
{ tbase = str;
tbase = str;
}
// printf("add: wrap: %i|%i, width: %i '%s'\n", fmt->wrap_word, fmt->wrap_char, c->w, str); // printf("add: wrap: %i|%i, width: %i '%s'\n", fmt->wrap_word, fmt->wrap_char, c->w, str);
new_line = 0; new_line = 0;
empty_item = 0; empty_item = 0;