From ae05e43ed0749fe69dbc642b7ba9f975486ec4c3 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 git-svn-id: svn://10.0.0.236/trunk@206476 18797224-902f-48f8-a5cc-f745e15eee43 --- .../xul/base/src/tree/src/nsTreeBoxObject.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp index 910fac6e5a4..3374a8c0cfc 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp +++ b/mozilla/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); } }