forked from enlightenment/efl
edje: Edje_Edit - fix edje_edit_part_source_set
Summary: Fixed edje_edit_part_source_set so that it does not destroy TEXTBLOCK. Changed type check to switch-case to stress allowed types. @fix Reviewers: cedric, raster, seoz, Hermet Reviewed By: cedric CC: reutskiy.v.v, cedric Differential Revision: https://phab.enlightenment.org/D931 Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
This commit is contained in:
parent
2010de6810
commit
aec9cf0a3e
|
@ -2858,11 +2858,10 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
|
|||
Evas_Object *child_obj;
|
||||
//printf("Set source for part: %s [source: %s]\n", part, source);
|
||||
|
||||
if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
|
||||
return EINA_FALSE;
|
||||
|
||||
_edje_if_string_free(ed, rp->part->source);
|
||||
|
||||
switch(rp->part->type)
|
||||
{
|
||||
case EDJE_PART_TYPE_GROUP:
|
||||
{
|
||||
if ((rp->typedata.swallow) && (rp->typedata.swallow->swallowed_object))
|
||||
{
|
||||
_edje_real_part_swallow_clear(ed, rp);
|
||||
|
@ -2871,14 +2870,26 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
|
|||
}
|
||||
if (source)
|
||||
{
|
||||
rp->part->source = eina_stringshare_add(source);
|
||||
child_obj = edje_object_add(ed->base->evas);
|
||||
edje_object_file_set(child_obj, ed->file->path, source);
|
||||
_edje_real_part_swallow(ed, rp, child_obj, EINA_TRUE);
|
||||
}
|
||||
}
|
||||
case EDJE_PART_TYPE_TEXTBLOCK:
|
||||
{
|
||||
_edje_if_string_free(ed, rp->part->source);
|
||||
if (source)
|
||||
rp->part->source = eina_stringshare_add(source);
|
||||
else
|
||||
rp->part->source = NULL;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
case EDJE_PART_TYPE_EXTERNAL: //EXTERNAL part has source property but it cannot be changed
|
||||
default:
|
||||
{
|
||||
return EINA_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI int
|
||||
|
|
Loading…
Reference in New Issue