mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 17:24:29 +00:00
Bug 398295 When I delete multiple items in the Bookmarks Organizer, dozens of assertions appear (r=sspitzer)
This commit is contained in:
parent
e136016aac
commit
7050f23948
@ -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;
|
||||
},
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user