From 74ecf0e4936049b5cafed8983cb692119529eeb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Wed, 1 Jun 2011 14:03:29 +0200 Subject: [PATCH] Revert "Fix bug" The bug was present when introducing a dependency between containers, the children were not affected by the movement of the parent. The solution fixed this problem, but introduced others. For example when adding a dependency from a top level task that is not a container to a container. This reverts commit 48ba72511d1dd4b5da832c37679911a896202020. FEA: ItEr74S04BugFixing --- .../org/zkoss/ganttz/data/GanttDiagramGraph.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java b/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java index e811f23ac..58ca5d061 100644 --- a/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java +++ b/ganttzk/src/main/java/org/zkoss/ganttz/data/GanttDiagramGraph.java @@ -459,13 +459,6 @@ public class GanttDiagramGraph> implements @Override public int compare(Recalculation o1, Recalculation o2) { - // recalculations that are parent recalculations must go - // first - int result = asInt(o2.parentRecalculation) - - asInt(o1.parentRecalculation); - if (result != 0) { - return result; - } int o1Depth = onNullDefault( taskPointsByDepth.get(o1.taskPoint), Integer.MAX_VALUE, "no depth value for " @@ -474,7 +467,12 @@ public class GanttDiagramGraph> implements taskPointsByDepth.get(o2.taskPoint), Integer.MAX_VALUE, "no depth value for " + o2.taskPoint); - return o1Depth - o2Depth; + int result = o1Depth - o2Depth; + if (result == 0) { + return asInt(o2.parentRecalculation) + - asInt(o1.parentRecalculation); + } + return result; } private int asInt(boolean b) {