Bug 1260651 part.43 Rename nsAutoInsertContainerSelNotify to mozilla::AutoInsertContainerSelNotify r=mccr8
MozReview-Commit-ID: GEfM8GJO3xd
--- 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);