diff --git a/mailnews/addrbook/src/nsAbView.cpp b/mailnews/addrbook/src/nsAbView.cpp index 894e062ce3..66da0f648d 100644 --- a/mailnews/addrbook/src/nsAbView.cpp +++ b/mailnews/addrbook/src/nsAbView.cpp @@ -60,8 +60,10 @@ NS_IMETHODIMP nsAbView::ClearView() { mDirectory = nullptr; mAbViewListener = nullptr; - if (mTree) - mTree->SetView(nullptr); + if (mTree) { + IgnoredErrorResult rv2; + mTree->SetView(nullptr, mozilla::dom::CallerType::System, rv2); + } mTree = nullptr; mTreeSelection = nullptr; @@ -105,8 +107,7 @@ nsresult nsAbView::RemoveCardAt(int32_t row) // This needs to happen after we remove the card, as RowCountChanged() will call GetRowCount() if (mTree) { - rv = mTree->RowCountChanged(row, -1); - NS_ENSURE_SUCCESS(rv,rv); + mTree->RowCountChanged(row, -1); } if (mAbViewListener && !mSuppressCountChange) { @@ -172,7 +173,8 @@ NS_IMETHODIMP nsAbView::SetView(nsIAbDirectory *aAddressBook, { // Try and speed deletion of old cards by disconnecting the tree from us. mTreeSelection->ClearSelection(); - mTree->SetView(nullptr); + IgnoredErrorResult rv2; + mTree->SetView(nullptr, mozilla::dom::CallerType::System, rv2); } // Clear out old cards @@ -523,7 +525,7 @@ NS_IMETHODIMP nsAbView::GetCellText(int32_t row, nsTreeColumn* col, nsAString& _ return GetCardValue(card, colID, _retval); } -NS_IMETHODIMP nsAbView::SetTree(nsITreeBoxObject *tree) +NS_IMETHODIMP nsAbView::SetTree(mozilla::dom::XULTreeElement *tree) { mTree = tree; return NS_OK; @@ -545,9 +547,10 @@ nsresult nsAbView::InvalidateTree(int32_t row) return NS_OK; if (row == ALL_ROWS) - return mTree->Invalidate(); + mTree->Invalidate(); else - return mTree->InvalidateRow(row); + mTree->InvalidateRow(row); + return NS_OK; } NS_IMETHODIMP nsAbView::SelectionChangedXPCOM() @@ -907,7 +910,7 @@ nsresult nsAbView::AddCard(AbCard *abcard, bool selectCardAfterAdding, int32_t * // This needs to happen after we insert the card, as RowCountChanged() will call GetRowCount() if (mTree) - rv = mTree->RowCountChanged(*index, 1); + mTree->RowCountChanged(*index, 1); // Checking for mTree here works around core bug 399227 if (selectCardAfterAdding && mTreeSelection && mTree) { @@ -1162,8 +1165,7 @@ nsresult nsAbView::ReselectCards(nsIArray *aCards, nsIAbCard *aIndexCard) NS_ENSURE_SUCCESS(rv, rv); if (mTree) { - rv = mTree->EnsureRowIsVisible(currentIndex); - NS_ENSURE_SUCCESS(rv, rv); + mTree->EnsureRowIsVisible(currentIndex); } } diff --git a/mailnews/addrbook/src/nsAbView.h b/mailnews/addrbook/src/nsAbView.h index 49c3519f46..f47d73bc3b 100644 --- a/mailnews/addrbook/src/nsAbView.h +++ b/mailnews/addrbook/src/nsAbView.h @@ -10,7 +10,7 @@ #include "nsString.h" #include "nsIAbView.h" #include "nsITreeView.h" -#include "nsITreeBoxObject.h" +#include "mozilla/dom/XULTreeElement.h" #include "nsITreeSelection.h" #include "nsTArray.h" #include "nsIAbDirectory.h" @@ -62,7 +62,7 @@ private: nsresult GetCardValue(nsIAbCard *card, const nsAString& colID, nsAString &_retval); nsresult RefreshTree(); - nsCOMPtr mTree; + RefPtr mTree; nsCOMPtr mTreeSelection; nsCOMPtr mDirectory; nsTArray mCards; diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index 77e6691c5c..f5de66524f 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -2334,7 +2334,7 @@ nsMsgDBView::CellTextForColumn(int32_t aRow, } NS_IMETHODIMP -nsMsgDBView::SetTree(nsITreeBoxObject *tree) +nsMsgDBView::SetTree(mozilla::dom::XULTreeElement *tree) { mTree = tree; return NS_OK; @@ -3146,7 +3146,7 @@ nsMsgDBView::OperateOnMsgsInCollapsedThreads() { if (mTreeSelection) { - nsCOMPtr selTree; + RefPtr selTree; mTreeSelection->GetTree(getter_AddRefs(selTree)); // No tree means stand-alone message window. if (!selTree) diff --git a/mailnews/base/src/nsMsgDBView.h b/mailnews/base/src/nsMsgDBView.h index 698a588ca4..f103cc9009 100644 --- a/mailnews/base/src/nsMsgDBView.h +++ b/mailnews/base/src/nsMsgDBView.h @@ -14,7 +14,7 @@ #include "MailNewsTypes.h" #include "nsIDBChangeListener.h" #include "nsITreeView.h" -#include "nsITreeBoxObject.h" +#include "mozilla/dom/XULTreeElement.h" #include "nsITreeSelection.h" #include "nsIMsgFolder.h" #include "nsIMsgThread.h" @@ -134,7 +134,7 @@ protected: static char16_t* kForwardedString; static char16_t* kNewString; - nsCOMPtr mTree; + RefPtr mTree; nsCOMPtr mTreeSelection; // We cache this to determine when to push command status notifications. uint32_t mNumSelectedRows; diff --git a/mailnews/base/src/nsSubscribableServer.cpp b/mailnews/base/src/nsSubscribableServer.cpp index 0049cb4ce5..7642882f92 100644 --- a/mailnews/base/src/nsSubscribableServer.cpp +++ b/mailnews/base/src/nsSubscribableServer.cpp @@ -716,7 +716,7 @@ nsSubscribableServer::GetRowCount(int32_t *rowCount) } NS_IMETHODIMP -nsSubscribableServer::SetTree(nsITreeBoxObject *aTree) +nsSubscribableServer::SetTree(mozilla::dom::XULTreeElement *aTree) { mTree = aTree; return NS_OK; diff --git a/mailnews/base/src/nsSubscribableServer.h b/mailnews/base/src/nsSubscribableServer.h index b0651fa4a8..4bbb99344e 100644 --- a/mailnews/base/src/nsSubscribableServer.h +++ b/mailnews/base/src/nsSubscribableServer.h @@ -9,7 +9,7 @@ #include "nsCOMPtr.h" #include "nsString.h" #include "nsIMsgIncomingServer.h" -#include "nsITreeBoxObject.h" +#include "mozilla/dom/XULTreeElement.h" #include "nsITreeSelection.h" #include "nsITreeView.h" #include "nsISubscribableServer.h" @@ -67,7 +67,7 @@ private: SubscribeTreeNode *mTreeRoot; // root of the folder tree while items are discovered on the server nsTArray mRowMap; // array of nodes representing the rows for the tree element nsCOMPtr mSelection; - nsCOMPtr mTree; + RefPtr mTree; nsresult FreeSubtree(SubscribeTreeNode *node); nsresult FreeRows(); nsresult CreateNode(SubscribeTreeNode *parent, const char *name, const nsACString &aPath, SubscribeTreeNode **result); diff --git a/mailnews/news/src/nsNntpIncomingServer.cpp b/mailnews/news/src/nsNntpIncomingServer.cpp index 9d3719395b..df54951f30 100644 --- a/mailnews/news/src/nsNntpIncomingServer.cpp +++ b/mailnews/news/src/nsNntpIncomingServer.cpp @@ -31,7 +31,7 @@ #include "mozilla/Services.h" #include "mozilla/dom/Element.h" #include "mozilla/ErrorResult.h" -#include "nsITreeBoxObject.h" +#include "mozilla/dom/XULTreeElement.h" #include "mozilla/dom/DataTransfer.h" #define INVALID_VERSION 0 @@ -1869,14 +1869,13 @@ nsNntpIncomingServer::GetCellText(int32_t row, nsTreeColumn* col, nsAString& _re } NS_IMETHODIMP -nsNntpIncomingServer::SetTree(nsITreeBoxObject *tree) +nsNntpIncomingServer::SetTree(mozilla::dom::XULTreeElement *tree) { mTree = tree; if (!tree) return NS_OK; - RefPtr cols; - tree->GetColumns(getter_AddRefs(cols)); + RefPtr cols = tree->GetColumns(); if (!cols) return NS_OK; diff --git a/mailnews/news/src/nsNntpIncomingServer.h b/mailnews/news/src/nsNntpIncomingServer.h index d825091b88..bd7357d1a4 100644 --- a/mailnews/news/src/nsNntpIncomingServer.h +++ b/mailnews/news/src/nsNntpIncomingServer.h @@ -104,7 +104,7 @@ private: // in the search view nsTArray mTempSubscribed; - nsCOMPtr mTree; + RefPtr mTree; nsCOMPtr mTreeSelection; bool mHasSeenBeginGroups;