From 41ea6e81d6aa74d5cb93122899ba7da2d25309fb Mon Sep 17 00:00:00 2001 From: Kateryna Fesyna Date: Thu, 6 Nov 2014 06:04:39 +0100 Subject: [PATCH] edje: Edje_Edit - fix segfaults on restacking of text parts with set 'text_source'. Summary: This commit fixes segfault on restacking text parts with set 'text_source' that is caused by wrong updaiting of 'text_source' IDs on restacking of parts due to typo. @fix Reviewers: Hermet, seoz, raster, cedric Reviewed By: cedric Subscribers: cedric, reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D1646 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_edit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index bd908d75d4..b7247acd3b 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -645,13 +645,12 @@ _edje_part_description_id_switch(int type, Edje_Part_Description_Common *c, int || type == EDJE_PART_TYPE_TEXTBLOCK) { Edje_Part_Description_Text *t; - t = (Edje_Part_Description_Text *) c; if (t->text.id_source == id1) t->text.id_source = id2; else if (t->text.id_source == id2) t->text.id_source = id1; if (t->text.id_text_source == id1) t->text.id_text_source = id2; - else if (t->text.id_text_source == id2) t->text.id_text_source = id2; + else if (t->text.id_text_source == id2) t->text.id_text_source = id1; } } @@ -6528,7 +6527,7 @@ edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state, (rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)) && (real->typedata.text) && (real->typedata.text->text_source == rp)) { - txt = (Edje_Part_Description_Text *) real; + txt = _edje_real_part_text_text_source_description_get(real, NULL); _edje_if_string_free(ed, txt->text.text.str); txt->text.text.str = (char *)eina_stringshare_add(text); txt->text.text.id = 0;