Bug 425529 - Undo function does not work for deleted tags in the Library. r=dietrich.

This commit is contained in:
mozilla.mano%sent.com 2008-04-02 20:04:46 +00:00
Родитель e5f416cbbf
Коммит 3c0dda396a
1 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -932,7 +932,19 @@ placesTagURITransaction.prototype = {
function placesUntagURITransaction(aURI, aTags) {
this._uri = aURI;
this._tags = aTags || PlacesUtils.tagging.getTagsForURI(this._uri, {});
if (aTags) {
// Within this transaction, we cannot rely on tags given by itemId
// since the tag containers may be gone after we call untagURI.
// Thus, we convert each tag given by its itemId to name.
this._tags = aTags;
for (var i=0; i < aTags.length; i++) {
if (typeof(this._tags[i]) == "number")
this._tags[i] = PlacesUtils.bookmarks.getItemTitle(this._tags[i]);
}
}
else
this._tags = PlacesUtils.tagging.getTagsForURI(this._uri, {});
this.redoTransaction = this.doTransaction;
}