bug=327209 r=brettw Fixes assert when removing from a toolbar

This commit is contained in:
annie.sullivan%gmail.com 2006-02-14 23:48:28 +00:00
Родитель 79aa08b5ec
Коммит 81c6a85481
1 изменённых файлов: 12 добавлений и 6 удалений

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

@ -1095,11 +1095,17 @@ nsNavHistoryContainerResultNode::RemoveChildAt(PRInt32 aIndex,
PRBool isContainer = mChildren[aIndex]->IsContainer();
PRBool isContainerOpen = PR_FALSE;
PRInt32 visibleRows = 1;
if (isContainer) {
isContainerOpen = mChildren[aIndex]->GetAsContainer()->mExpanded;
if (isContainerOpen)
visibleRows = result->CountVisibleRowsForItem(mChildren[aIndex]);
PRInt32 visibleRows;
if (AreChildrenVisible()) {
if (isContainer) {
isContainerOpen = mChildren[aIndex]->GetAsContainer()->mExpanded;
if (isContainerOpen)
visibleRows = result->CountVisibleRowsForItem(mChildren[aIndex]);
} else {
visibleRows = 1;
}
} else {
visibleRows = 0;
}
PRInt32 childVisibleIndex = mChildren[aIndex]->mVisibleIndex;
@ -1115,7 +1121,7 @@ nsNavHistoryContainerResultNode::RemoveChildAt(PRInt32 aIndex,
// remove from our list and notify the tree
mChildren.RemoveObjectAt(aIndex);
if (AreChildrenVisible() && childVisibleIndex >= 0)
if (visibleRows && childVisibleIndex >= 0)
result->RowsRemoved(childVisibleIndex, visibleRows);
if (! aIsTemporary) {