From 7ffaab9d4bc655f5ffcd5df571acf185b80df4c7 Mon Sep 17 00:00:00 2001 From: "chanial%noos.fr" Date: Tue, 28 Jan 2003 07:08:54 +0000 Subject: [PATCH] Fix bug in getIndexOfResourceInContainer and some regressions in the bookmark manager: - DND should keep the selection - selection for undo and redo commands --- .../bookmarks/content/bookmarksTree.xml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/browser/components/bookmarks/content/bookmarksTree.xml b/browser/components/bookmarks/content/bookmarksTree.xml index 62a67465249e..8cdda7e4cc5d 100644 --- a/browser/components/bookmarks/content/bookmarksTree.xml +++ b/browser/components/bookmarks/content/bookmarksTree.xml @@ -326,11 +326,11 @@ if (!aParent) return -1; var index = this.treeBuilder.getIndexOfResource(aParent) - if (index == -1) + if (index == -1 && !aParent.EqualsNode(RDF.GetResource("NC:BookmarksRoot"))) return -1; - if (!this.treeBoxObject.view.isContainerOpen(index)) + if (index != -1 && !this.treeBoxObject.view.isContainerOpen(index)) return -1; - while (++index < this.treeBuilder.rowCount) { + while (++index < this.treeBoxObject.view.rowCount) { if (this.treeBuilder.getResourceAtIndex(index) == aItem && this.getParentResource(index) == aParent) return index; @@ -448,6 +448,9 @@ case "cmd_bm_newbookmark": case "cmd_bm_newfolder": case "cmd_bm_newseparator": + // [Category 2 bis] - Temporary hack + case "cmd_undo": + case "cmd_redo": // All items inserted will be selected. The implementation of this model // is left to |preUpdateTreeSelection|, called when an insert transaction is // executed, and |updateTreeSelection| called here. @@ -480,7 +483,8 @@