Skip to content

Commit

Permalink
Bug 1260651 part.52 Rename nsAutoLockListener to mozilla::AutoLockLis…
Browse files Browse the repository at this point in the history
…tener r=mccr8

MozReview-Commit-ID: 728oPlrpb3Q
  • Loading branch information
masayuki-nakano committed Jun 24, 2016
1 parent 3257602 commit fcae8ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion editor/libeditor/HTMLEditRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1325,7 +1325,7 @@ HTMLEditRules::WillInsertText(EditAction aAction,
// 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);
Expand Down
20 changes: 10 additions & 10 deletions editor/libeditor/TextEditRules.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,34 +324,34 @@ class MOZ_STACK_CLASS AutoLockRulesSniffing final
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

0 comments on commit fcae8ca

Please sign in to comment.