diff --git a/content/xul/templates/src/nsXULTreeBuilder.cpp b/content/xul/templates/src/nsXULTreeBuilder.cpp index c452dbed9d31..e24e69f2535c 100644 --- a/content/xul/templates/src/nsXULTreeBuilder.cpp +++ b/content/xul/templates/src/nsXULTreeBuilder.cpp @@ -1459,8 +1459,9 @@ nsXULTreeBuilder::GetTemplateActionCellFor(PRInt32 aRow, nsCOMPtr row; GetTemplateActionRowFor(aRow, getter_AddRefs(row)); if (row) { - PRInt32 colIndex; - mBoxObject->GetColumnIndex(aColID, &colIndex); + PRInt32 colIndex = -1; + if (mBoxObject) + mBoxObject->GetColumnIndex(aColID, &colIndex); PRInt32 count; row->ChildCount(count); diff --git a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp index 88a69f272d2a..cecd9bd7c900 100644 --- a/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBoxObject.cpp @@ -62,8 +62,6 @@ public: NS_IMETHOD Init(nsIContent* aContent, nsIPresShell* aPresShell); NS_IMETHOD SetDocument(nsIDocument* aDocument); NS_IMETHOD InvalidatePresentationStuff(); - - nsITreeBoxObject* mTreeBody; }; /* Implementation file */ @@ -84,8 +82,6 @@ nsTreeBoxObject::SetDocument(nsIDocument* aDocument) if (treeView) treeView->SetTree(nsnull); // Break the circular ref between the view and us. - mTreeBody = nsnull; - return nsBoxObject::SetDocument(aDocument); } @@ -100,7 +96,6 @@ nsTreeBoxObject::InvalidatePresentationStuff() } nsTreeBoxObject::nsTreeBoxObject() -:mTreeBody(nsnull) { NS_INIT_ISUPPORTS(); } diff --git a/layout/xul/base/src/tree/src/nsTreeContentView.cpp b/layout/xul/base/src/tree/src/nsTreeContentView.cpp index d5e103bad6ea..a2cc9a2395a4 100644 --- a/layout/xul/base/src/tree/src/nsTreeContentView.cpp +++ b/layout/xul/base/src/tree/src/nsTreeContentView.cpp @@ -1563,8 +1563,9 @@ nsTreeContentView::UpdateParentIndexes(PRInt32 aIndex, PRInt32 aSkip, PRInt32 aC nsresult nsTreeContentView::GetNamedCell(nsIContent* aContainer, const PRUnichar* aColID, nsIContent** aResult) { - PRInt32 colIndex; - mBoxObject->GetColumnIndex(aColID, &colIndex); + PRInt32 colIndex = -1; + if (mBoxObject) + mBoxObject->GetColumnIndex(aColID, &colIndex); // Traverse through cells, try to find the cell by "ref" attribute or by cell // index in a row. "ref" attribute has higher priority.