Fixing bug 594547, crash downstream from nsTreeContentView::InsertRow(). r=bzbarsky@mit.edu, tnikkel@gmail.com, a=jst@mozilla.org

This commit is contained in:
Johnny Stenback 2010-11-17 14:30:14 -08:00
Родитель 4bdeaddd6f
Коммит 5564f047b7
1 изменённых файлов: 8 добавлений и 5 удалений

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

@ -1091,11 +1091,14 @@ nsTreeContentView::ContentInserted(nsIDocument *aDocument,
}
else if (childTag == nsGkAtoms::option) {
PRInt32 parentIndex = FindContent(aContainer);
PRInt32 index = 0;
GetIndexInSubtree(aContainer, aChild, &index);
PRInt32 count = InsertRow(parentIndex, index, aChild);
if (mBoxObject)
mBoxObject->RowCountChanged(parentIndex + index + 1, count);
if (parentIndex >= 0) {
PRInt32 index = 0;
GetIndexInSubtree(aContainer, aChild, &index);
PRInt32 count = InsertRow(parentIndex, index, aChild);
if (mBoxObject)
mBoxObject->RowCountChanged(parentIndex + index + 1, count);
}
}
}