зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
9f194945cf
Коммит
e49b147dce
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче