Bug 1260651 part.43 Rename nsAutoInsertContainerSelNotify to mozilla::AutoInsertContainerSelNotify r=mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 24 Jun 2016 15:21:35 +0900
changeset 385875 d2631aada1c0f1e106b5f80d360d2af5105a46a6
parent 385874 8453c4b0359e6e595e8c32cc165ce8d7340afb60
child 385876 304f1f8a9334ac7ad79376340fe3466a50d31579
push id22587
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 06:59:31 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.43 Rename nsAutoInsertContainerSelNotify to mozilla::AutoInsertContainerSelNotify r=mccr8 MozReview-Commit-ID: GEfM8GJO3xd
editor/libeditor/SelectionState.h
editor/libeditor/nsEditor.cpp
--- a/editor/libeditor/SelectionState.h
+++ b/editor/libeditor/SelectionState.h
@@ -287,42 +287,40 @@ public:
   }
 
   ~AutoRemoveContainerSelNotify()
   {
     mRangeUpdater.DidRemoveContainer(mNode, mParent, mOffset, mNodeOrigLen);
   }
 };
 
-} // namespace mozilla
-
-/***************************************************************************
- * another helper class for SelectionState.  stack based class for doing
+/**
+ * Another helper class for SelectionState.  Stack based class for doing
  * Will/DidInsertContainer()
  */
 
-class MOZ_STACK_CLASS nsAutoInsertContainerSelNotify
+class MOZ_STACK_CLASS AutoInsertContainerSelNotify final
 {
-  private:
-    mozilla::RangeUpdater& mRU;
+private:
+  RangeUpdater& mRangeUpdater;
 
-  public:
-    explicit nsAutoInsertContainerSelNotify(
-               mozilla::RangeUpdater& aRangeUpdater) :
-    mRU(aRangeUpdater)
-    {
-      mRU.WillInsertContainer();
-    }
+public:
+  explicit AutoInsertContainerSelNotify(RangeUpdater& aRangeUpdater)
+    : mRangeUpdater(aRangeUpdater)
+  {
+    mRangeUpdater.WillInsertContainer();
+  }
 
-    ~nsAutoInsertContainerSelNotify()
-    {
-      mRU.DidInsertContainer();
-    }
+  ~AutoInsertContainerSelNotify()
+  {
+    mRangeUpdater.DidInsertContainer();
+  }
 };
 
+} // namespace mozilla
 
 /***************************************************************************
  * another helper class for SelectionState.  stack based class for doing
  * Will/DidMoveNode()
  */
 
 class MOZ_STACK_CLASS nsAutoMoveNodeSelNotify
 {
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -1658,17 +1658,17 @@ nsEditor::InsertContainerAbove(nsIConten
   // Set attribute if needed
   nsresult res;
   if (aAttribute && aValue && aAttribute != nsGkAtoms::_empty) {
     res = newContent->SetAttr(kNameSpaceID_None, aAttribute, *aValue, true);
     NS_ENSURE_SUCCESS(res, nullptr);
   }
 
   // Notify our internal selection state listener
-  nsAutoInsertContainerSelNotify selNotify(mRangeUpdater);
+  AutoInsertContainerSelNotify selNotify(mRangeUpdater);
 
   // Put inNode in new parent, outNode
   res = DeleteNode(aNode);
   NS_ENSURE_SUCCESS(res, nullptr);
 
   {
     AutoTransactionsConserveSelection conserveSelection(this);
     res = InsertNode(*aNode, *newContent, 0);