Skip to content

Commit 729e312

Browse files
Bug 1260651 part.54 Rename nsHTMLEditorEventListeners to mozilla::HTMLEditorEventListener (and their file names) r=mccr8
MozReview-Commit-ID: DFW3E2WfXzJ --HG-- rename : editor/libeditor/nsHTMLEditorEventListener.cpp => editor/libeditor/HTMLEditorEventListener.cpp rename : editor/libeditor/nsHTMLEditorEventListener.h => editor/libeditor/HTMLEditorEventListener.h
1 parent 5c69175 commit 729e312

File tree

6 files changed

+27
-28
lines changed

6 files changed

+27
-28
lines changed

editor/libeditor/nsHTMLEditorEventListener.cpp renamed to editor/libeditor/HTMLEditorEventListener.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

6-
#include "nsHTMLEditorEventListener.h"
6+
#include "HTMLEditorEventListener.h"
77

88
#include "HTMLEditUtils.h"
99
#include "mozilla/dom/Event.h"
@@ -27,17 +27,13 @@
2727
#include "nsQueryObject.h"
2828
#include "nsRange.h"
2929

30-
using namespace mozilla;
31-
using namespace mozilla::dom;
30+
namespace mozilla {
3231

33-
/*
34-
* nsHTMLEditorEventListener implementation
35-
*
36-
*/
32+
using namespace dom;
3733

3834
#ifdef DEBUG
3935
nsresult
40-
nsHTMLEditorEventListener::Connect(nsEditor* aEditor)
36+
HTMLEditorEventListener::Connect(nsEditor* aEditor)
4137
{
4238
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryObject(aEditor);
4339
nsCOMPtr<nsIHTMLInlineTableEditor> htmlInlineTableEditor =
@@ -49,14 +45,14 @@ nsHTMLEditorEventListener::Connect(nsEditor* aEditor)
4945
#endif
5046

5147
nsHTMLEditor*
52-
nsHTMLEditorEventListener::GetHTMLEditor()
48+
HTMLEditorEventListener::GetHTMLEditor()
5349
{
5450
// mEditor must be nsHTMLEditor or its subclass.
5551
return static_cast<nsHTMLEditor*>(mEditor);
5652
}
5753

5854
nsresult
59-
nsHTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
55+
HTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
6056
{
6157
nsHTMLEditor* htmlEditor = GetHTMLEditor();
6258

@@ -75,7 +71,7 @@ nsHTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
7571
}
7672

7773
nsresult
78-
nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
74+
HTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
7975
{
8076
nsHTMLEditor* htmlEditor = GetHTMLEditor();
8177
// Contenteditable should disregard mousedowns outside it.
@@ -205,7 +201,7 @@ nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
205201
}
206202

207203
nsresult
208-
nsHTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)
204+
HTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)
209205
{
210206
nsCOMPtr<nsIDOMEventTarget> target;
211207
nsresult rv = aMouseEvent->AsEvent()->GetTarget(getter_AddRefs(target));
@@ -217,3 +213,5 @@ nsHTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)
217213

218214
return nsEditorEventListener::MouseClick(aMouseEvent);
219215
}
216+
217+
} // namespace mozilla

editor/libeditor/nsHTMLEditorEventListener.h renamed to editor/libeditor/HTMLEditorEventListener.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
* License, v. 2.0. If a copy of the MPL was not distributed with this
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

6-
#ifndef nsHTMLEditorEventListener_h__
7-
#define nsHTMLEditorEventListener_h__
6+
#ifndef HTMLEditorEventListener_h
7+
#define HTMLEditorEventListener_h
88

99
#include "nsEditorEventListener.h"
1010
#include "nscore.h"
1111

1212
class nsEditor;
1313
class nsHTMLEditor;
1414

15-
class nsHTMLEditorEventListener : public nsEditorEventListener
15+
namespace mozilla {
16+
17+
class HTMLEditorEventListener final : public nsEditorEventListener
1618
{
1719
public:
18-
nsHTMLEditorEventListener() :
19-
nsEditorEventListener()
20+
HTMLEditorEventListener()
2021
{
2122
}
2223

23-
virtual ~nsHTMLEditorEventListener()
24+
virtual ~HTMLEditorEventListener()
2425
{
2526
}
2627

@@ -37,5 +38,6 @@ class nsHTMLEditorEventListener : public nsEditorEventListener
3738
inline nsHTMLEditor* GetHTMLEditor();
3839
};
3940

40-
#endif // nsHTMLEditorEventListener_h__
41+
} // namespace mozilla
4142

43+
#endif // #ifndef HTMLEditorEventListener_h

editor/libeditor/moz.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ UNIFIED_SOURCES += [
3838
'EditorController.cpp',
3939
'EditorUtils.cpp',
4040
'EditTransactionBase.cpp',
41+
'HTMLEditorEventListener.cpp',
4142
'HTMLEditRules.cpp',
4243
'HTMLEditUtils.cpp',
4344
'HTMLURIRefObject.cpp',
@@ -51,7 +52,6 @@ UNIFIED_SOURCES += [
5152
'nsHTMLAnonymousUtils.cpp',
5253
'nsHTMLDataTransfer.cpp',
5354
'nsHTMLEditor.cpp',
54-
'nsHTMLEditorEventListener.cpp',
5555
'nsHTMLEditorStyle.cpp',
5656
'nsHTMLInlineTableEditor.cpp',
5757
'nsHTMLObjectResizer.cpp',

editor/libeditor/nsEditorEventListener.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ nsEditorEventListener::NotifyIMEOfMouseButtonEvent(
770770
nsresult
771771
nsEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
772772
{
773-
// FYI: This may be called by nsHTMLEditorEventListener::MouseDown() even
773+
// FYI: This may be called by HTMLEditorEventListener::MouseDown() even
774774
// when the event is not acceptable for committing composition.
775775
mEditor->ForceCompositionEnd();
776776
return NS_OK;

editor/libeditor/nsHTMLEditor.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@
1313

1414
#include "nsUnicharUtils.h"
1515

16+
#include "HTMLEditorEventListener.h"
1617
#include "HTMLEditRules.h"
1718
#include "HTMLEditUtils.h"
1819
#include "HTMLURIRefObject.h"
1920
#include "SetDocumentTitleTransaction.h"
2021
#include "StyleSheetTransactions.h"
2122
#include "TextEditUtils.h"
22-
23-
#include "nsHTMLEditorEventListener.h"
2423
#include "TypeInState.h"
2524

26-
2725
#include "nsIDOMText.h"
2826
#include "nsIDOMMozNamedAttrMap.h"
2927
#include "nsIDOMNodeList.h"
@@ -442,7 +440,7 @@ nsHTMLEditor::CreateEventListeners()
442440
{
443441
// Don't create the handler twice
444442
if (!mEventListener) {
445-
mEventListener = new nsHTMLEditorEventListener();
443+
mEventListener = new HTMLEditorEventListener();
446444
}
447445
}
448446

@@ -455,8 +453,8 @@ nsHTMLEditor::InstallEventListeners()
455453
// NOTE: nsHTMLEditor doesn't need to initialize mEventTarget here because
456454
// the target must be document node and it must be referenced as weak pointer.
457455

458-
nsHTMLEditorEventListener* listener =
459-
reinterpret_cast<nsHTMLEditorEventListener*>(mEventListener.get());
456+
HTMLEditorEventListener* listener =
457+
reinterpret_cast<HTMLEditorEventListener*>(mEventListener.get());
460458
return listener->Connect(this);
461459
}
462460

editor/libeditor/nsHTMLEditor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class nsIDOMRange;
5353
class nsRange;
5454

5555
namespace mozilla {
56+
class HTMLEditorEventListener;
5657
class HTMLEditRules;
5758
class TextEditRules;
5859
class TypeInState;
@@ -974,10 +975,10 @@ class nsHTMLEditor final : public nsPlaintextEditor,
974975

975976
public:
976977
// friends
978+
friend class mozilla::HTMLEditorEventListener;
977979
friend class mozilla::HTMLEditRules;
978980
friend class mozilla::TextEditRules;
979981
friend class mozilla::WSRunObject;
980-
friend class nsHTMLEditorEventListener;
981982

982983
private:
983984
// Helpers

0 commit comments

Comments
 (0)