Evas textblock: Fix an issue with empty textblocks.

SVN revision: 59800
This commit is contained in:
Tom Hacohen 2011-05-30 07:52:44 +00:00
parent 41121f7379
commit 6b894e69fa
1 changed files with 6 additions and 10 deletions

View File

@ -2827,7 +2827,7 @@ skip:
goto end; goto end;
} }
while (str) do
{ {
Evas_Font_Instance *script_fi = NULL; Evas_Font_Instance *script_fi = NULL;
int script_len, tmp_cut; int script_len, tmp_cut;
@ -2843,16 +2843,16 @@ skip:
} }
/* FIXME: This is a possible fix for an infinite loops that happens /* FIXME: This is a possible fix for an infinite loops that happens
* if script_len <= 0. Should find the source of the issue, * if script_len < 0. Should find the source of the issue,
* i.e why (off - (str - tbase)) is ever < 0. I can't reproduce the * i.e why (off - (str - tbase)) is ever < 0. I can't reproduce the
* issue so I can't really do anything about it. */ * issue so I can't really do anything about it. */
if (script_len <= 0) if (script_len < 0)
break; break;
script = evas_common_language_script_type_get(str, script_len); script = evas_common_language_script_type_get(str, script_len);
while (script_len > 0) do
{ {
Evas_Font_Instance *cur_fi; Evas_Font_Instance *cur_fi;
int run_len = script_len; int run_len = script_len;
@ -2883,13 +2883,9 @@ skip:
_layout_text_add_logical_item(c, ti, NULL); _layout_text_add_logical_item(c, ti, NULL);
} }
while (script_len > 0);
/* Break if we reached the end. We do it here
* because we want at least one run if it's an empty string. */
if (!*str)
break;
} }
while (*str);
end: end:
if (alloc_str) free(alloc_str); if (alloc_str) free(alloc_str);