Bug 1518823 - Port bug 1482389: Replace nsITreeBoxObject with XULTreeElement. rs=bustage-fix

This commit is contained in:
Jorg K 2019-01-15 10:42:51 +01:00
Родитель 83a428811f
Коммит 9913cef015
8 изменённых файлов: 26 добавлений и 25 удалений

Просмотреть файл

@ -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);
}
}

Просмотреть файл

@ -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<nsITreeBoxObject> mTree;
RefPtr<mozilla::dom::XULTreeElement> mTree;
nsCOMPtr<nsITreeSelection> mTreeSelection;
nsCOMPtr <nsIAbDirectory> mDirectory;
nsTArray<AbCard*> mCards;

Просмотреть файл

@ -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<nsITreeBoxObject> selTree;
RefPtr<mozilla::dom::XULTreeElement> selTree;
mTreeSelection->GetTree(getter_AddRefs(selTree));
// No tree means stand-alone message window.
if (!selTree)

Просмотреть файл

@ -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<nsITreeBoxObject> mTree;
RefPtr<mozilla::dom::XULTreeElement> mTree;
nsCOMPtr<nsITreeSelection> mTreeSelection;
// We cache this to determine when to push command status notifications.
uint32_t mNumSelectedRows;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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<SubscribeTreeNode*> mRowMap; // array of nodes representing the rows for the tree element
nsCOMPtr<nsITreeSelection> mSelection;
nsCOMPtr<nsITreeBoxObject> mTree;
RefPtr<mozilla::dom::XULTreeElement> mTree;
nsresult FreeSubtree(SubscribeTreeNode *node);
nsresult FreeRows();
nsresult CreateNode(SubscribeTreeNode *parent, const char *name, const nsACString &aPath, SubscribeTreeNode **result);

Просмотреть файл

@ -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<nsTreeColumns> cols;
tree->GetColumns(getter_AddRefs(cols));
RefPtr<nsTreeColumns> cols = tree->GetColumns();
if (!cols)
return NS_OK;

Просмотреть файл

@ -104,7 +104,7 @@ private:
// in the search view
nsTArray<nsCString> mTempSubscribed;
nsCOMPtr<nsITreeBoxObject> mTree;
RefPtr<mozilla::dom::XULTreeElement> mTree;
nsCOMPtr<nsITreeSelection> mTreeSelection;
bool mHasSeenBeginGroups;