Bug 391178 - Avoid walking frame tree when destroying nsTreeColFrame. r+sr=roc, a=blocking1.9+

This commit is contained in:
dholbert@cs.stanford.edu 2007-11-19 18:01:19 -08:00
Родитель 429a4537a2
Коммит 3e6be1cbe7
2 изменённых файлов: 14 добавлений и 4 удалений

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

@ -45,6 +45,7 @@
#include "nsIDOMNSDocument.h"
#include "nsIDocument.h"
#include "nsIBoxObject.h"
#include "nsTreeBoxObject.h"
#include "nsIDOMElement.h"
#include "nsITreeBoxObject.h"
#include "nsITreeColumns.h"
@ -99,7 +100,7 @@ nsTreeColFrame::Init(nsIContent* aContent,
void
nsTreeColFrame::Destroy()
{
InvalidateColumns();
InvalidateColumns(PR_FALSE);
nsBoxFrame::Destroy();
}
@ -220,12 +221,21 @@ nsTreeColFrame::GetTreeBoxObject()
}
void
nsTreeColFrame::InvalidateColumns()
nsTreeColFrame::InvalidateColumns(PRBool aCanWalkFrameTree)
{
nsITreeBoxObject* treeBoxObject = GetTreeBoxObject();
if (treeBoxObject) {
nsCOMPtr<nsITreeColumns> columns;
treeBoxObject->GetColumns(getter_AddRefs(columns));
if (aCanWalkFrameTree) {
treeBoxObject->GetColumns(getter_AddRefs(columns));
} else {
nsITreeBoxObject* body =
static_cast<nsTreeBoxObject*>(treeBoxObject)->GetCachedTreeBody();
if (body) {
body->GetColumns(getter_AddRefs(columns));
}
}
if (columns)
columns->InvalidateColumns();

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

@ -89,5 +89,5 @@ protected:
* Helper method that gets the nsITreeColumns object this column belongs to
* and calls InvalidateColumns() on it.
*/
void InvalidateColumns();
void InvalidateColumns(PRBool aCanWalkFrameTree = PR_TRUE);
};