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 385733 79504b071dbf0bf50e5be456f7f8e1255447a9ef
parent 385732 f51ec81bc7d05d43ac84d41794560eac4de93748
child 385734 1e54980084c341e0e19934ff5c02a0268c509100
push id22582
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 03:13:39 +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);