Bug 1260651 part.42 Rename nsAutoRemoveContainerSelNotify to mozilla::AutoRemoveContainerSelNotify r=mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 07 Jul 2016 18:27:18 +0900
changeset 385874 8453c4b0359e6e595e8c32cc165ce8d7340afb60
parent 385873 7d56f47a088dabd34c8febae6e2a9adf1fc5e8e8
child 385875 d2631aada1c0f1e106b5f80d360d2af5105a46a6
push id22587
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 06:59:31 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.42 Rename nsAutoRemoveContainerSelNotify to mozilla::AutoRemoveContainerSelNotify r=mccr8 MozReview-Commit-ID: GyU26vXBGyt
editor/libeditor/SelectionState.h
editor/libeditor/nsEditor.cpp
--- a/editor/libeditor/SelectionState.h
+++ b/editor/libeditor/SelectionState.h
@@ -252,54 +252,53 @@ public:
   }
 
   ~AutoReplaceContainerSelNotify()
   {
     mRangeUpdater.DidReplaceContainer(mOriginalElement, mNewElement);
   }
 };
 
-} // namespace mozilla
-
-
-/***************************************************************************
- * another helper class for SelectionState.  stack based class for doing
+/**
+ * Another helper class for SelectionState.  Stack based class for doing
  * Will/DidRemoveContainer()
  */
 
-class MOZ_STACK_CLASS nsAutoRemoveContainerSelNotify
+class MOZ_STACK_CLASS AutoRemoveContainerSelNotify final
 {
-  private:
-    mozilla::RangeUpdater& mRU;
-    nsIDOMNode *mNode;
-    nsIDOMNode *mParent;
-    int32_t    mOffset;
-    uint32_t   mNodeOrigLen;
+private:
+  RangeUpdater& mRangeUpdater;
+  nsIDOMNode* mNode;
+  nsIDOMNode* mParent;
+  int32_t mOffset;
+  uint32_t mNodeOrigLen;
 
-  public:
-    nsAutoRemoveContainerSelNotify(mozilla::RangeUpdater& aRangeUpdater,
-                                   nsINode* aNode,
-                                   nsINode* aParent,
-                                   int32_t aOffset,
-                                   uint32_t aNodeOrigLen)
-      : mRU(aRangeUpdater)
-      , mNode(aNode->AsDOMNode())
-      , mParent(aParent->AsDOMNode())
-      , mOffset(aOffset)
-      , mNodeOrigLen(aNodeOrigLen)
-    {
-      mRU.WillRemoveContainer();
-    }
+public:
+  AutoRemoveContainerSelNotify(RangeUpdater& aRangeUpdater,
+                               nsINode* aNode,
+                               nsINode* aParent,
+                               int32_t aOffset,
+                               uint32_t aNodeOrigLen)
+    : mRangeUpdater(aRangeUpdater)
+    , mNode(aNode->AsDOMNode())
+    , mParent(aParent->AsDOMNode())
+    , mOffset(aOffset)
+    , mNodeOrigLen(aNodeOrigLen)
+  {
+    mRangeUpdater.WillRemoveContainer();
+  }
 
-    ~nsAutoRemoveContainerSelNotify()
-    {
-      mRU.DidRemoveContainer(mNode, mParent, mOffset, mNodeOrigLen);
-    }
+  ~AutoRemoveContainerSelNotify()
+  {
+    mRangeUpdater.DidRemoveContainer(mNode, mParent, mOffset, mNodeOrigLen);
+  }
 };
 
+} // namespace mozilla
+
 /***************************************************************************
  * another helper class for SelectionState.  stack based class for doing
  * Will/DidInsertContainer()
  */
 
 class MOZ_STACK_CLASS nsAutoInsertContainerSelNotify
 {
   private:
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -1612,18 +1612,18 @@ nsEditor::RemoveContainer(nsIContent* aN
   NS_ENSURE_STATE(parent);
 
   int32_t offset = parent->IndexOf(aNode);
 
   // Loop through the children of inNode and promote them into inNode's parent
   uint32_t nodeOrigLen = aNode->GetChildCount();
 
   // notify our internal selection state listener
-  nsAutoRemoveContainerSelNotify selNotify(mRangeUpdater, aNode, parent,
-                                           offset, nodeOrigLen);
+  AutoRemoveContainerSelNotify selNotify(mRangeUpdater, aNode, parent,
+                                         offset, nodeOrigLen);
 
   while (aNode->HasChildren()) {
     nsCOMPtr<nsIContent> child = aNode->GetLastChild();
     nsresult rv = DeleteNode(child);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = InsertNode(*child, *parent, offset);
     NS_ENSURE_SUCCESS(rv, rv);