diff --git a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp index 8f8f26baeafa..5b72ba8bff3c 100644 --- a/layout/xul/base/src/tree/src/nsTreeColFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeColFrame.cpp @@ -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 columns; - treeBoxObject->GetColumns(getter_AddRefs(columns)); + + if (aCanWalkFrameTree) { + treeBoxObject->GetColumns(getter_AddRefs(columns)); + } else { + nsITreeBoxObject* body = + static_cast(treeBoxObject)->GetCachedTreeBody(); + if (body) { + body->GetColumns(getter_AddRefs(columns)); + } + } if (columns) columns->InvalidateColumns(); diff --git a/layout/xul/base/src/tree/src/nsTreeColFrame.h b/layout/xul/base/src/tree/src/nsTreeColFrame.h index 570676872bbf..26bf02604179 100644 --- a/layout/xul/base/src/tree/src/nsTreeColFrame.h +++ b/layout/xul/base/src/tree/src/nsTreeColFrame.h @@ -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); };