From efa9bd2bd3af0484353e85c49487850b313a6fda Mon Sep 17 00:00:00 2001 From: "sspitzer%mozilla.org" Date: Sat, 14 Jul 2007 04:17:51 +0000 Subject: [PATCH] fix for bug #387952: Folder annotations should be kept intact for delete / undo transactions patch=Christine Yen r=sspitzer --- browser/components/places/content/controller.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/browser/components/places/content/controller.js b/browser/components/places/content/controller.js index 3ab3e3869d3..9eb5ac008cc 100755 --- a/browser/components/places/content/controller.js +++ b/browser/components/places/content/controller.js @@ -1887,8 +1887,10 @@ PlacesRemoveFolderTransaction.prototype = { }, doTransaction: function PRFT_doTransaction() { - var title = this.bookmarks.getItemTitle(this._id); - this.LOG("Remove Folder: " + title); + this._title = this.bookmarks.getItemTitle(this._id); + this._annotations = this.utils.getAnnotationsForItem(this._id); + + this.LOG("Remove Folder: " + this._title); this._saveFolderContents(); @@ -1903,8 +1905,11 @@ PlacesRemoveFolderTransaction.prototype = { undoTransaction: function PRFT_undoTransaction() { this._removeTxn.undoTransaction(); - var title = this.bookmarks.getItemTitle(this._id); - this.LOG("UNRemove Folder: " + title); + this.LOG("UNRemove Folder: " + this._title); + + // Repopulate annotations + if (this._annotations && this._annotations.length > 0) + this.utils.setAnnotationsForItem(this._id, this._annotations); // Create children forwards to preserve parent-child relationships. for (var i = 0; i < this._transactions.length; ++i)