Bug 709523 - Part b: Remove nsDOMIterator::ForEach; r=ehsan a=edmorley
authorMs2ger <ms2ger@gmail.com>
Sun, 11 Dec 2011 21:00:25 +0100
changeset 84057 b9e76ec6ac89b22e674734c6aa8e2e1f0860cde4
parent 84056 cd7bd3b20de03eb7a6ff9d0d299d9b2166eeb46c
child 84058 9c4cd94a11d7348adb08f87af304e20204ac864e
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, edmorley
bugs709523
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 709523 - Part b: Remove nsDOMIterator::ForEach; r=ehsan a=edmorley
editor/libeditor/base/nsEditorUtils.cpp
editor/libeditor/base/nsEditorUtils.h
--- a/editor/libeditor/base/nsEditorUtils.cpp
+++ b/editor/libeditor/base/nsEditorUtils.cpp
@@ -116,33 +116,16 @@ nsDOMIterator::Init(nsIDOMNode* aNode)
   nsresult res;
   mIter = do_CreateInstance("@mozilla.org/content/post-content-iterator;1", &res);
   NS_ENSURE_SUCCESS(res, res);
   NS_ENSURE_TRUE(mIter, NS_ERROR_FAILURE);
   nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
   return mIter->Init(content);
 }
 
-void
-nsDOMIterator::ForEach(nsDomIterFunctor& functor) const
-{
-  nsCOMPtr<nsIDOMNode> node;
-  
-  // iterate through dom
-  while (!mIter->IsDone())
-  {
-    node = do_QueryInterface(mIter->GetCurrentNode());
-    if (!node)
-      return;
-
-    functor(node);
-    mIter->Next();
-  }
-}
-
 nsresult
 nsDOMIterator::AppendList(nsBoolDomIterFunctor& functor,
                           nsCOMArray<nsIDOMNode>& arrayOfNodes) const
 {
   nsCOMPtr<nsIDOMNode> node;
   
   // iterate through dom and build list
   while (!mIter->IsDone())
--- a/editor/libeditor/base/nsEditorUtils.h
+++ b/editor/libeditor/base/nsEditorUtils.h
@@ -183,37 +183,30 @@ class NS_STACK_CLASS nsAutoUpdateViewBat
   protected:
   nsEditor *mEd;
 };
 
 /******************************************************************************
  * some helper classes for iterating the dom tree
  *****************************************************************************/
 
-class nsDomIterFunctor 
-{
-  public:
-    virtual void* operator()(nsIDOMNode* aNode)=0;
-};
-
 class nsBoolDomIterFunctor 
 {
   public:
     virtual bool operator()(nsIDOMNode* aNode)=0;
 };
 
 class NS_STACK_CLASS nsDOMIterator
 {
   public:
     nsDOMIterator();
     virtual ~nsDOMIterator();
     
     nsresult Init(nsIDOMRange* aRange);
     nsresult Init(nsIDOMNode* aNode);
-    void ForEach(nsDomIterFunctor& functor) const;
     nsresult AppendList(nsBoolDomIterFunctor& functor,
                         nsCOMArray<nsIDOMNode>& arrayOfNodes) const;
   protected:
     nsCOMPtr<nsIContentIterator> mIter;
 };
 
 class nsDOMSubtreeIterator : public nsDOMIterator
 {