aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2015-12-15 15:34:06 (GMT)
committerAndrii Kroitor <an.kroitor@samsung.com>2015-12-15 15:34:06 (GMT)
commit4334cac5541434d66ee4080edd1b46f46ac276e6 (patch)
tree7c3d93301447f3794e41216540c1eab320958fde
parenttabs: add opening group as change to history (diff)
downloadeflete-4334cac5541434d66ee4080edd1b46f46ac276e6.tar.gz
editor: fix deletion of last part
-rw-r--r--src/bin/editor/editor_part.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c
index b868cdf..17dcadd 100644
--- a/src/bin/editor/editor_part.c
+++ b/src/bin/editor/editor_part.c
@@ -697,9 +697,9 @@ editor_part_restack(Evas_Object *edit_object, Change *change, Eina_Bool merge,
assert(edit_object != NULL);
assert(part_name != NULL);
+ old_relative_part = edje_edit_part_above_get(edit_object, part_name);
if (change)
{
- old_relative_part = edje_edit_part_above_get(edit_object, part_name);
diff = mem_calloc(1, sizeof(Diff));
diff->redo.type = FUNCTION_TYPE_STRING_STRING;
diff->redo.function = editor_part_restack;
@@ -721,8 +721,11 @@ editor_part_restack(Evas_Object *edit_object, Change *change, Eina_Bool merge,
}
else
{
- if (!edje_edit_part_restack_above(edit_object, part_name))
- return false;
+ /* edje_edit don't allows to restack_above part that is already on top,
+ but it is needed to simplify adding part deletion to history */
+ if (old_relative_part != NULL)
+ if (!edje_edit_part_restack_above(edit_object, part_name))
+ return false;
}
_editor_project_changed();