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 <cedric@osg.samsung.com>
This commit is contained in:
parent
4dd2b89213
commit
41ea6e81d6
|
@ -645,13 +645,12 @@ _edje_part_description_id_switch(int type, Edje_Part_Description_Common *c, int
|
||||||
|| type == EDJE_PART_TYPE_TEXTBLOCK)
|
|| type == EDJE_PART_TYPE_TEXTBLOCK)
|
||||||
{
|
{
|
||||||
Edje_Part_Description_Text *t;
|
Edje_Part_Description_Text *t;
|
||||||
|
|
||||||
t = (Edje_Part_Description_Text *) c;
|
t = (Edje_Part_Description_Text *) c;
|
||||||
|
|
||||||
if (t->text.id_source == id1) t->text.id_source = id2;
|
if (t->text.id_source == id1) t->text.id_source = id2;
|
||||||
else if (t->text.id_source == id2) t->text.id_source = id1;
|
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;
|
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)) &&
|
(rp->part->type == EDJE_PART_TYPE_TEXTBLOCK)) &&
|
||||||
(real->typedata.text) && (real->typedata.text->text_source == rp))
|
(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);
|
_edje_if_string_free(ed, txt->text.text.str);
|
||||||
txt->text.text.str = (char *)eina_stringshare_add(text);
|
txt->text.text.str = (char *)eina_stringshare_add(text);
|
||||||
txt->text.text.id = 0;
|
txt->text.text.id = 0;
|
||||||
|
|
Loading…
Reference in New Issue