From: raster Date: Mon, 21 Feb 2011 06:12:28 +0000 (+0000) Subject: fix bug with prev/cur text state access in text obj for utf8 string. X-Git-Tag: accepted/2.0/20130306.225542~242^2~998 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8da61a1b088663c11cda1f89402376cc051f203f;p=profile%2Fivi%2Fevas.git fix bug with prev/cur text state access in text obj for utf8 string. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@57201 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/ChangeLog b/ChangeLog index f85b45b..756ecdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. + diff --git a/src/lib/canvas/evas_object_text.c b/src/lib/canvas/evas_object_text.c index 505cea5..73d03b6 100644 --- a/src/lib/canvas/evas_object_text.c +++ b/src/lib/canvas/evas_object_text.c @@ -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)) ||