Bug 1260651 part.44 Rename nsAutoMoveNodeSelNotify to mozilla::AutoMoveNodeSelNotify r?mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 24 Jun 2016 15:24:44 +0900
changeset 385734 1e54980084c341e0e19934ff5c02a0268c509100
parent 385733 79504b071dbf0bf50e5be456f7f8e1255447a9ef
child 385735 a825948666a568e13de5ef463e12694e8681bde2
push id22582
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 03:13:39 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
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)