Bug 1260651 part.52 Rename nsAutoLockListener to mozilla::AutoLockListener r=mccr8
MozReview-Commit-ID: 728oPlrpb3Q
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -1320,17 +1320,17 @@ HTMLEditRules::WillInsertText(EditAction
NS_ENSURE_STATE(mHTMLEditor);
res = mHTMLEditor->IsPreformatted(GetAsDOMNode(selNode), &isPRE);
NS_ENSURE_SUCCESS(res, res);
// turn off the edit listener: we know how to
// build the "doc changed range" ourselves, and it's
// must faster to do it once here than to track all
// the changes one at a time.
- nsAutoLockListener lockit(&mListenerEnabled);
+ AutoLockListener lockit(&mListenerEnabled);
// don't spaz my selection in subtransactions
NS_ENSURE_STATE(mHTMLEditor);
AutoTransactionsConserveSelection dontSpazMySelection(mHTMLEditor);
nsAutoString tString(*inString);
const char16_t *unicodeBuf = tString.get();
int32_t pos = 0;
NS_NAMED_LITERAL_STRING(newlineStr, LFSTR);
--- a/editor/libeditor/TextEditRules.h
+++ b/editor/libeditor/TextEditRules.h
@@ -319,39 +319,39 @@ public:
mRules->mLockRulesSniffing = false;
}
}
protected:
TextEditRules* mRules;
};
-} // namespace mozilla
-
-/***************************************************************************
- * stack based helper class for turning on/off the edit listener.
+/**
+ * Stack based helper class for turning on/off the edit listener.
*/
-class nsAutoLockListener
+class MOZ_STACK_CLASS AutoLockListener final
{
public:
-
- explicit nsAutoLockListener(bool *enabled)
- : mEnabled(enabled), mOldState(false)
+ explicit AutoLockListener(bool* aEnabled)
+ : mEnabled(aEnabled)
+ , mOldState(false)
{
if (mEnabled) {
mOldState = *mEnabled;
*mEnabled = false;
}
}
- ~nsAutoLockListener()
+ ~AutoLockListener()
{
if (mEnabled) {
*mEnabled = mOldState;
}
}
protected:
- bool *mEnabled;
+ bool* mEnabled;
bool mOldState;
};
+} // namespace mozilla
+
#endif // #ifndef mozilla_TextEditRules_h