From 8ec79a2eb9f1f4aafd962fe7577855cac13c3327 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Wed, 31 Oct 2012 15:16:19 -0700 Subject: [PATCH] Fixed bugs with deleting a task messing up indent model --- .../todoroo/astrid/subtasks/NewOrderedListUpdater.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/subtasks/NewOrderedListUpdater.java b/astrid/plugin-src/com/todoroo/astrid/subtasks/NewOrderedListUpdater.java index f98ca76d6..c37e88851 100644 --- a/astrid/plugin-src/com/todoroo/astrid/subtasks/NewOrderedListUpdater.java +++ b/astrid/plugin-src/com/todoroo/astrid/subtasks/NewOrderedListUpdater.java @@ -235,9 +235,15 @@ public abstract class NewOrderedListUpdater { Node parent = task.parent; ArrayList siblings = parent.children; - siblings.remove(task); + int index = siblings.indexOf(task); + + siblings.remove(index); for (Node child : task.children) { - indentHelper(child, -1); + child.parent = parent; + child.indent = parent.indent + 1; + siblings.add(index, child); + adjustDescendantsIndent(child, child.indent); + index++; } idToNode.remove(taskId); }