summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/HTMLEditorEventListener.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-06-26 14:05:33 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-06-26 14:05:33 +0200
commit8a8f0df35849ad27cc8ed1ccce8baead46a7656a (patch)
treecaf407bca05010da70605ba2b5b73b5a856396df /editor/libeditor/HTMLEditorEventListener.cpp
parent6aa47456c3d5d1952212ff3e970f617e5f6f3617 (diff)
downloadUXP-8a8f0df35849ad27cc8ed1ccce8baead46a7656a.tar
UXP-8a8f0df35849ad27cc8ed1ccce8baead46a7656a.tar.gz
UXP-8a8f0df35849ad27cc8ed1ccce8baead46a7656a.tar.lz
UXP-8a8f0df35849ad27cc8ed1ccce8baead46a7656a.tar.xz
UXP-8a8f0df35849ad27cc8ed1ccce8baead46a7656a.zip
Issue #12 Part 4: Don't access mEditorBase directly.
EditorEventListener should grab mEditorBase in a smaller scope wherever possible and shouldn't access it directly while handling an event. Each event listener method shouldn't access mEditorBase directly when calling its method since it might be changed to another instance.
Diffstat (limited to 'editor/libeditor/HTMLEditorEventListener.cpp')
-rw-r--r--editor/libeditor/HTMLEditorEventListener.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/libeditor/HTMLEditorEventListener.cpp b/editor/libeditor/HTMLEditorEventListener.cpp
index a22188483..aa767519c 100644
--- a/editor/libeditor/HTMLEditorEventListener.cpp
+++ b/editor/libeditor/HTMLEditorEventListener.cpp
@@ -120,7 +120,7 @@ HTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(target);
if (isContextClick || (buttonNumber == 0 && clickCount == 2)) {
- RefPtr<Selection> selection = mEditorBase->GetSelection();
+ RefPtr<Selection> selection = htmlEditor->GetSelection();
NS_ENSURE_TRUE(selection, NS_OK);
// Get location of mouse within target node