Bug 161452 Tree content and builder views may need to recheck empty status after children are removed based on patch by kyle yuan r=varga sr=bryner

This commit is contained in:
neil%parkwaycc.co.uk 2003-10-10 08:39:35 +00:00
Родитель 9f194945cf
Коммит e49b147dce
3 изменённых файлов: 11 добавлений и 9 удалений

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

@ -388,12 +388,13 @@ public:
/**
* Remove the specified row from the view
*/
void
PRInt32
RemoveRowAt(iterator& aIterator) {
iterator temp = aIterator++;
iterator temp = aIterator--;
Subtree* parent = temp.GetParent();
parent->RemoveRowAt(temp.GetChildIndex());
InvalidateCachedRow(); }
InvalidateCachedRow();
return parent->Count(); }
/**
* Insert a new match into the view

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

@ -1705,7 +1705,7 @@ nsXULContentBuilder::ReplaceMatch(nsIRDFResource* aMember,
RemoveMember(content, member, PR_TRUE);
if (aNewMatch) {
if (!aNewMatch) {
// If there's no new match, then go ahead an update the
// container attributes now.
SetContainerAttrs(content, aOldMatch);

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

@ -1113,11 +1113,12 @@ nsXULTreeBuilder::ReplaceMatch(nsIRDFResource* aMember,
// Remove the rows from the view
PRInt32 row = iter.GetRowIndex();
PRInt32 delta = mRows.GetSubtreeSizeFor(iter);
mRows.RemoveRowAt(iter);
// XXX Could potentially invalidate the iterator's
// mContainer[Type|State] caching here, but it'll work
// itself out.
if (mRows.RemoveRowAt(iter) == 0) {
// In this case iter now points to its parent
// Invalidate the row's cached fill state
iter->mContainerFill = nsTreeRows::eContainerFill_Unknown;
mBoxObject->InvalidatePrimaryCell(iter.GetRowIndex());
}
// Notify the box object
mBoxObject->RowCountChanged(row, -delta - 1);