From 790344c5d837caf764561e1dd0045d92e4d201c6 Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Thu, 3 Aug 2006 08:54:46 +0000 Subject: [PATCH] Bug 346957 Reconnect the view to the tree after a reframe r+sr=roc --- layout/xul/base/src/tree/src/nsTreeBoxObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp index 910fac6e5a4..3374a8c0cfc 100644 --- a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp @@ -161,7 +161,18 @@ nsTreeBoxObject::GetTreeBody() NS_IMETHODIMP nsTreeBoxObject::GetView(nsITreeView * *aView) { - if (!mView && GetTreeBody()) { + if (!mTreeBody) { + if (!GetTreeBody()) { + // Don't return an uninitialised view + *aView = nsnull; + return NS_OK; + } + + if (mView) + // Our new frame needs to initialise itself + return mTreeBody->GetView(aView); + } + if (!mView) { nsCOMPtr xulele = do_QueryInterface(mContent); if (xulele) { // See if there is a XUL tree builder associated with the element @@ -175,6 +186,7 @@ NS_IMETHODIMP nsTreeBoxObject::GetView(nsITreeView * *aView) NS_ENSURE_TRUE(rv, rv); } + // Initialise the frame and view mTreeBody->SetView(mView); } }