rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=4d7040ef1a8392678ce050572c06ba5e9d040e7a

commit 4d7040ef1a8392678ce050572c06ba5e9d040e7a
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Tue Jul 28 16:44:28 2015 +0300

    History: fix part restack
    
    Restacking part above should work properly.
    
    If restacking part above, and undoing it, history was restacking it in 
wrong way
    
    @fix #45702
---
 src/bin/history/history_part.c           | 13 +++++++++++--
 src/bin/project_manager/widget_manager.c | 16 +++++++++-------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/bin/history/history_part.c b/src/bin/history/history_part.c
index 4321751..f2d357c 100644
--- a/src/bin/history/history_part.c
+++ b/src/bin/history/history_part.c
@@ -185,7 +185,12 @@ _part_redo(Evas_Object *source, Part_Diff *change)
          ui_widget_list_style_parts_reload(widget_list, style);
       break;
       case RESTACK:
-         wm_style_parts_restack(style, change->part, change->params->above);
+
+         if (!change->params->last)
+           wm_style_parts_restack(style, change->part, change->params->above);
+         else
+           wm_style_parts_restack(style, change->part, NULL);
+
          above = edje_edit_part_above_get(style->obj, change->part);
          if (!above)
            {
@@ -274,7 +279,11 @@ _part_undo(Evas_Object *source, Part_Diff *change)
              last = true;
            }
 
-         wm_style_parts_restack(style, change->part, change->params->above);
+         if (!change->params->last)
+           wm_style_parts_restack(style, change->part, change->params->above);
+         else
+           wm_style_parts_restack(style, change->part, NULL);
+
          workspace_edit_object_part_restack(app->workspace, change->part,
                                             change->params->above,
                                             change->params->last);
diff --git a/src/bin/project_manager/widget_manager.c 
b/src/bin/project_manager/widget_manager.c
index e6ac33f..0f3ed2d 100644
--- a/src/bin/project_manager/widget_manager.c
+++ b/src/bin/project_manager/widget_manager.c
@@ -935,11 +935,13 @@ wm_style_parts_restack(Style *style, Eina_Stringshare 
*part_name,
 
    EINA_INLIST_FOREACH(style->parts, data)
      {
-        TODO("Check logic here. Seems like we are skipping rel_part if part 
was found earlier")
-        if (data->name == part_name) part = data;
+        if (data->name == part_name)
+          part = data;
         else if (data->name == rel_name)
-         rel_part = data;
-        if (part) break;
+          rel_part = data;
+
+        if (part && rel_part)
+          break;
      }
 
    assert(part != NULL);
@@ -949,13 +951,13 @@ wm_style_parts_restack(Style *style, Eina_Stringshare 
*part_name,
    assert(tmp_list != NULL);
 
    if (rel_part)
-    tmp_prev = eina_inlist_find(style->parts, EINA_INLIST_GET(rel_part));
+     tmp_prev = eina_inlist_find(style->parts, EINA_INLIST_GET(rel_part));
 
    style->parts = eina_inlist_remove(style->parts, tmp_list);
    if (!tmp_prev)
-      style->parts = eina_inlist_append_relative(style->parts, tmp_list, 
tmp_prev);
+     style->parts = eina_inlist_append_relative(style->parts, tmp_list, 
tmp_prev);
    else
-      style->parts = eina_inlist_prepend_relative(style->parts, tmp_list, 
tmp_prev);
+     style->parts = eina_inlist_prepend_relative(style->parts, tmp_list, 
tmp_prev);
 
    return true;
 }

-- 


Reply via email to