Bug 1260651 part.44 Rename nsAutoMoveNodeSelNotify to mozilla::AutoMoveNodeSelNotify r=mccr8
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 24 Jun 2016 15:24:44 +0900
changeset 304339 6d434a1e0d7a293877952867e02175df7f5313e0
parent 304338 c16c0839f7c21b9332c8d782cf1e3fde3becdd53
child 304340 20196b8fc22b1a8da8cabb671bbcc3d45f5a50eb
push id79299
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 08:01:22 +0000
treeherdermozilla-inbound@942dac383054 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1260651
milestone50.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 1260651 part.44 Rename nsAutoMoveNodeSelNotify to mozilla::AutoMoveNodeSelNotify r=mccr8 MozReview-Commit-ID: Bahm520giss
editor/libeditor/SelectionState.h
editor/libeditor/nsEditor.cpp
--- a/editor/libeditor/SelectionState.h
+++ b/editor/libeditor/SelectionState.h
@@ -310,48 +310,48 @@ public:
   }
 
   ~AutoInsertContainerSelNotify()
   {
     mRangeUpdater.DidInsertContainer();
   }
 };
 
-} // namespace mozilla
-
-/***************************************************************************
- * another helper class for SelectionState.  stack based class for doing
+/**
+ * Another helper class for SelectionState.  Stack based class for doing
  * Will/DidMoveNode()
  */
 
-class MOZ_STACK_CLASS nsAutoMoveNodeSelNotify
+class MOZ_STACK_CLASS AutoMoveNodeSelNotify final
 {
-  private:
-    mozilla::RangeUpdater& mRU;
-    nsINode* mOldParent;
-    nsINode* mNewParent;
-    int32_t    mOldOffset;
-    int32_t    mNewOffset;
+private:
+  RangeUpdater& mRangeUpdater;
+  nsINode* mOldParent;
+  nsINode* mNewParent;
+  int32_t mOldOffset;
+  int32_t mNewOffset;
 
-  public:
-    nsAutoMoveNodeSelNotify(mozilla::RangeUpdater& aRangeUpdater,
-                            nsINode* aOldParent,
-                            int32_t aOldOffset,
-                            nsINode* aNewParent,
-                            int32_t aNewOffset)
-      : mRU(aRangeUpdater)
-      , mOldParent(aOldParent)
-      , mNewParent(aNewParent)
-      , mOldOffset(aOldOffset)
-      , mNewOffset(aNewOffset)
-    {
-      MOZ_ASSERT(aOldParent);
-      MOZ_ASSERT(aNewParent);
-      mRU.WillMoveNode();
-    }
+public:
+  AutoMoveNodeSelNotify(RangeUpdater& aRangeUpdater,
+                        nsINode* aOldParent,
+                        int32_t aOldOffset,
+                        nsINode* aNewParent,
+                        int32_t aNewOffset)
+    : mRangeUpdater(aRangeUpdater)
+    , mOldParent(aOldParent)
+    , mNewParent(aNewParent)
+    , mOldOffset(aOldOffset)
+    , mNewOffset(aNewOffset)
+  {
+    MOZ_ASSERT(aOldParent);
+    MOZ_ASSERT(aNewParent);
+    mRangeUpdater.WillMoveNode();
+  }
 
-    ~nsAutoMoveNodeSelNotify()
-    {
-      mRU.DidMoveNode(mOldParent, mOldOffset, mNewParent, mNewOffset);
-    }
+  ~AutoMoveNodeSelNotify()
+  {
+    mRangeUpdater.DidMoveNode(mOldParent, mOldOffset, mNewParent, mNewOffset);
+  }
 };
 
+} // namespace mozilla
+
 #endif // #ifndef SelectionState_h
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -1702,18 +1702,18 @@ nsEditor::MoveNode(nsIContent* aNode, ns
   }
 
   // Don't do anything if it's already in right place
   if (aParent == oldParent && aOffset == oldOffset) {
     return NS_OK;
   }
 
   // Notify our internal selection state listener
-  nsAutoMoveNodeSelNotify selNotify(mRangeUpdater, oldParent, oldOffset,
-                                    aParent, aOffset);
+  AutoMoveNodeSelNotify selNotify(mRangeUpdater, oldParent, oldOffset,
+                                  aParent, aOffset);
 
   // Need to adjust aOffset if we're moving aNode later in its current parent
   if (aParent == oldParent && oldOffset < aOffset) {
     // When we delete aNode, it will make the offsets after it off by one
     aOffset--;
   }
 
   // Hold a reference so aNode doesn't go away when we remove it (bug 772282)