fix bug with prev/cur text state access in text obj for utf8 string.

SVN revision: 57201
This commit is contained in:
Carsten Haitzler 2011-02-21 06:12:28 +00:00
parent 18f48360fc
commit a3808761cc
2 changed files with 11 additions and 13 deletions

View File

@ -110,3 +110,9 @@
* Fix bug in font string parsing that can result in a crash if a
font element is long enough.
* Fiix convert rgba8888 -> a8 bug so it wont crash.
2011-02-21 Carsten Haitzler (The Rasterman)
* Fixed bug with memory access of old utf8 string when
comparing prev and cur state with text obj.

View File

@ -673,11 +673,8 @@ evas_object_text_text_set(Evas_Object *obj, const char *_text)
return;
MAGIC_CHECK_END();
if ((o->cur.utf8_text) && (_text) &&
(!strcmp(o->cur.utf8_text, _text)))
{
return;
}
if ((o->cur.utf8_text) && (_text) && (!strcmp(o->cur.utf8_text, _text)))
return;
text = eina_unicode_utf8_to_unicode(_text, &len);
if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
@ -693,6 +690,7 @@ evas_object_text_text_set(Evas_Object *obj, const char *_text)
{
_evas_object_text_layout(obj, o, text);
eina_stringshare_replace(&o->cur.utf8_text, _text);
o->prev.utf8_text = NULL;
}
else
{
@ -2138,14 +2136,8 @@ evas_object_text_render_pre(Evas_Object *obj)
if (o->changed)
{
if ((o->cur.size != o->prev.size) ||
((o->cur.font) && (o->prev.font) &&
(strcmp(o->cur.font, o->prev.font))) ||
((o->cur.font) && (!o->prev.font)) ||
((!o->cur.font) && (o->prev.font)) ||
((o->cur.utf8_text) && (o->prev.utf8_text) &&
(strcmp(o->cur.utf8_text, o->prev.utf8_text))) ||
((o->cur.utf8_text) && (!o->prev.utf8_text)) ||
((!o->cur.utf8_text) && (o->prev.utf8_text)) ||
((o->cur.font != o->prev.font)) ||
((o->cur.utf8_text != o->prev.utf8_text)) ||
((o->cur.style != o->prev.style)) ||
((o->cur.shadow.r != o->prev.shadow.r)) ||
((o->cur.shadow.g != o->prev.shadow.g)) ||