From 438c8f83998c9115d1bdebd59917a2985ff40076 Mon Sep 17 00:00:00 2001 From: "rjc%netscape.com" Date: Wed, 15 Mar 2000 09:59:04 +0000 Subject: [PATCH] Fix bug # 22521: context menus should work on background of bookmarks window and background of bookmarks sidebar panel. --- .../bookmarks/resources/bookmarks.js | 34 +++++++++++++------ .../bookmarks/src/nsBookmarksService.cpp | 6 +++- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/xpfe/components/bookmarks/resources/bookmarks.js b/xpfe/components/bookmarks/resources/bookmarks.js index 532c0200314..378a381af6f 100644 --- a/xpfe/components/bookmarks/resources/bookmarks.js +++ b/xpfe/components/bookmarks/resources/bookmarks.js @@ -205,7 +205,7 @@ function doPaste() if (RDFC.IndexOf(IDRes) > 0) { - dump("Unable to add ID:'" + theID + "' as its already in this folder.\n"); + debug("Unable to add ID:'" + theID + "' as its already in this folder.\n"); continue; } @@ -506,17 +506,29 @@ function fillContextMenu(name) var select_list = treeNode.selectedItems; - debug("# of Nodes selected: " + treeNode.selectedItems.length); + debug("# of Nodes selected: " + treeNode.selectedItems.length + "\n"); // perform intersection of commands over selected nodes var cmdArray = new Array(); - - for (var nodeIndex=0; nodeIndexAppendElement(kNC_BookmarkCommand_DeleteBookmark); } - if (isBookmarkFolder) + if (isBookmarkFolder && (source != kNC_BookmarksRoot)) { cmdArray->AppendElement(kNC_BookmarkCommand_DeleteBookmarkFolder); } @@ -3640,6 +3640,10 @@ nsBookmarksService::ReadBookmarks() NS_ASSERTION(NS_SUCCEEDED(rv), "Unable to make NC:BookmarksRoot a sequence"); if (NS_FAILED(rv)) return rv; + // Make sure bookmark's root has the correct type + rv = mInner->Assert(kNC_BookmarksRoot, kRDF_type, kNC_Folder, PR_TRUE); + if (NS_FAILED(rv)) return rv; + PRBool foundIERoot = PR_FALSE; #ifdef DEBUG