mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1154701 part 14 - Remove unused nsCOMArray cruft; r=ehsan
This commit is contained in:
parent
ceee182c20
commit
5559b42167
@ -7,7 +7,6 @@
|
||||
|
||||
#include "mozilla/dom/OwningNonNull.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIClipboardDragDropHookList.h"
|
||||
@ -104,20 +103,6 @@ nsDOMIterator::AppendList(const nsBoolDomIterFunctor& functor,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsDOMIterator::AppendList(const nsBoolDomIterFunctor& functor,
|
||||
nsCOMArray<nsIDOMNode>& arrayOfNodes) const
|
||||
{
|
||||
// iterate through dom and build list
|
||||
for (; !mIter->IsDone(); mIter->Next()) {
|
||||
nsCOMPtr<nsIDOMNode> node = mIter->GetCurrentNode()->AsDOMNode();
|
||||
|
||||
if (functor(node)) {
|
||||
arrayOfNodes.AppendObject(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsDOMSubtreeIterator::nsDOMSubtreeIterator(nsRange& aRange)
|
||||
{
|
||||
mIter = NS_NewContentSubtreeIterator();
|
||||
|
@ -19,7 +19,6 @@ class nsIAtom;
|
||||
class nsIContentIterator;
|
||||
class nsIDOMDocument;
|
||||
class nsRange;
|
||||
template <class E> class nsCOMArray;
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
template <class T> class OwningNonNull;
|
||||
@ -168,11 +167,7 @@ class MOZ_STACK_CLASS nsAutoUpdateViewBatch
|
||||
class nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
virtual bool operator()(nsIDOMNode* aNode) const = 0;
|
||||
bool operator()(nsINode* aNode) const
|
||||
{
|
||||
return operator()(GetAsDOMNode(aNode));
|
||||
}
|
||||
virtual bool operator()(nsINode* aNode) const = 0;
|
||||
};
|
||||
|
||||
class MOZ_STACK_CLASS nsDOMIterator
|
||||
@ -184,8 +179,6 @@ class MOZ_STACK_CLASS nsDOMIterator
|
||||
|
||||
void AppendList(const nsBoolDomIterFunctor& functor,
|
||||
nsTArray<mozilla::dom::OwningNonNull<nsINode>>& arrayOfNodes) const;
|
||||
void AppendList(const nsBoolDomIterFunctor& functor,
|
||||
nsCOMArray<nsIDOMNode>& arrayOfNodes) const;
|
||||
protected:
|
||||
nsCOMPtr<nsIContentIterator> mIter;
|
||||
|
||||
@ -204,7 +197,7 @@ class nsTrivialFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
// Used to build list of all nodes iterator covers
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ class nsTableCellAndListItemFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
// Used to build list of all li's, td's & th's iterator covers
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
if (nsHTMLEditUtils::IsTableCell(aNode)) return true;
|
||||
if (nsHTMLEditUtils::IsListItem(aNode)) return true;
|
||||
@ -118,9 +118,11 @@ class nsTableCellAndListItemFunctor : public nsBoolDomIterFunctor
|
||||
class nsBRNodeFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
if (nsTextEditUtils::IsBreak(aNode)) return true;
|
||||
if (aNode->IsHTMLElement(nsGkAtoms::br)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@ -129,12 +131,11 @@ class nsEmptyEditableFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
explicit nsEmptyEditableFunctor(nsHTMLEditor* editor) : mHTMLEditor(editor) {}
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
if (mHTMLEditor->IsEditable(aNode) &&
|
||||
(nsHTMLEditUtils::IsListItem(aNode) ||
|
||||
nsHTMLEditUtils::IsTableCellOrCaption(aNode)))
|
||||
{
|
||||
(nsHTMLEditUtils::IsListItem(aNode) ||
|
||||
nsHTMLEditUtils::IsTableCellOrCaption(GetAsDOMNode(aNode)))) {
|
||||
bool bIsEmptyNode;
|
||||
nsresult res = mHTMLEditor->IsEmptyNode(aNode, &bIsEmptyNode, false, false);
|
||||
NS_ENSURE_SUCCESS(res, false);
|
||||
@ -151,7 +152,7 @@ class nsEditableTextFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
explicit nsEditableTextFunctor(nsHTMLEditor* editor) : mHTMLEditor(editor) {}
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
if (nsEditor::IsTextNode(aNode) && mHTMLEditor->IsEditable(aNode))
|
||||
{
|
||||
@ -5718,15 +5719,6 @@ nsHTMLEditRules::PromoteRange(nsRange& aRange, EditAction aOperationType)
|
||||
MOZ_ASSERT(NS_SUCCEEDED(res));
|
||||
}
|
||||
|
||||
class NodeComparator
|
||||
{
|
||||
public:
|
||||
bool Equals(const nsINode* node, const nsIDOMNode* domNode) const
|
||||
{
|
||||
return domNode == GetAsDOMNode(const_cast<nsINode*>(node));
|
||||
}
|
||||
};
|
||||
|
||||
class nsUniqueFunctor : public nsBoolDomIterFunctor
|
||||
{
|
||||
public:
|
||||
@ -5734,9 +5726,9 @@ public:
|
||||
{
|
||||
}
|
||||
// used to build list of all nodes iterator covers
|
||||
virtual bool operator()(nsIDOMNode* aNode) const
|
||||
virtual bool operator()(nsINode* aNode) const
|
||||
{
|
||||
return !mArray.Contains(aNode, NodeComparator());
|
||||
return !mArray.Contains(aNode);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -37,7 +37,6 @@ class Selection;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
struct DOMPoint;
|
||||
template <class E> class nsCOMArray;
|
||||
|
||||
struct StyleCache : public PropItem
|
||||
{
|
||||
|
@ -2988,8 +2988,6 @@ nsHTMLEditor::GetURLForStyleSheet(CSSStyleSheet* aStyleSheet,
|
||||
int32_t foundIndex = mStyleSheets.IndexOf(aStyleSheet);
|
||||
|
||||
// Don't fail if we don't find it in our list
|
||||
// Note: mStyleSheets is nsCOMArray, so its IndexOf() method
|
||||
// returns -1 on failure.
|
||||
if (foundIndex == -1)
|
||||
return NS_OK;
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "nsAString.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsEditorUtils.h"
|
||||
|
Loading…
Reference in New Issue
Block a user