Bug 398295 When I delete multiple items in the Bookmarks Organizer, dozens of assertions appear (r=sspitzer)

This commit is contained in:
dietrich@mozilla.com 2007-10-15 09:44:18 -07:00
parent e136016aac
commit 7050f23948
2 changed files with 9 additions and 12 deletions

View File

@ -69,7 +69,7 @@ PlacesTreeView.prototype = {
},
_ensureValidRow: function PTV__ensureValidRow(aRow) {
if (aRow < 0 || aRow > this._visibleElements.length)
if (aRow < 0 || aRow >= this._visibleElements.length)
throw Cr.NS_ERROR_INVALID_ARG;
},

View File

@ -3208,19 +3208,17 @@ nsNavHistoryFolderResultNode::OnItemRemoved(PRInt64 aItemId,
PRUint32 index;
nsNavHistoryResultNode* node = FindChildById(aItemId, &index);
if (!node) {
NS_NOTREACHED("Removing item we don't have");
return NS_ERROR_FAILURE;
if (mOptions->ExcludeItems()) {
return NS_OK; // if we're excluding items, this could be totally valid.
}
else {
NS_NOTREACHED("Removing item we don't have");
return NS_ERROR_FAILURE;
}
}
NS_ASSERTION(aParentFolder == mItemId, "Got wrong bookmark update");
if ((node->IsURI() || node->IsSeparator()) && mOptions->ExcludeItems()) {
// don't update items when we aren't displaying them, but we do need to
// adjust everybody's bookmark indices to account for the removal
ReindexRange(aIndex, PR_INT32_MAX, -1);
return NS_OK;
}
if (!StartIncrementalUpdate())
return NS_OK; // we are completely refreshed
@ -3909,8 +3907,7 @@ nsNavHistoryResult::OnItemChanged(PRInt64 aItemId,
if (folder) {
PRUint32 nodeIndex;
nsNavHistoryResultNode* node = folder->FindChildById(aItemId, &nodeIndex);
if (node && !(folder->mOptions->ExcludeItems()) &&
folder->StartIncrementalUpdate()) {
if (node && folder->StartIncrementalUpdate()) {
node->OnItemChanged(aItemId, aProperty, aIsAnnotationProperty, aValue);
}
}