diff options
Diffstat (limited to 'editor/libeditor/PlaceholderTransaction.cpp')
-rw-r--r-- | editor/libeditor/PlaceholderTransaction.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/editor/libeditor/PlaceholderTransaction.cpp b/editor/libeditor/PlaceholderTransaction.cpp index fa808afad..5a76e391a 100644 --- a/editor/libeditor/PlaceholderTransaction.cpp +++ b/editor/libeditor/PlaceholderTransaction.cpp @@ -8,6 +8,7 @@ #include "CompositionTransaction.h" #include "mozilla/EditorBase.h" #include "mozilla/dom/Selection.h" +#include "mozilla/Move.h" #include "nsGkAtoms.h" #include "nsQueryObject.h" @@ -15,13 +16,18 @@ namespace mozilla { using namespace dom; -PlaceholderTransaction::PlaceholderTransaction() +PlaceholderTransaction::PlaceholderTransaction( + EditorBase& aEditorBase, + nsIAtom* aName, + UniquePtr<SelectionState> aSelState) : mAbsorb(true) , mForwarding(nullptr) , mCompositionTransaction(nullptr) , mCommitted(false) - , mEditorBase(nullptr) + , mStartSel(Move(aSelState)) + , mEditorBase(&aEditorBase) { + mName = aName; } PlaceholderTransaction::~PlaceholderTransaction() @@ -57,19 +63,6 @@ NS_IMPL_ADDREF_INHERITED(PlaceholderTransaction, EditAggregateTransaction) NS_IMPL_RELEASE_INHERITED(PlaceholderTransaction, EditAggregateTransaction) NS_IMETHODIMP -PlaceholderTransaction::Init(nsIAtom* aName, - SelectionState* aSelState, - EditorBase* aEditorBase) -{ - NS_ENSURE_TRUE(aEditorBase && aSelState, NS_ERROR_NULL_POINTER); - - mName = aName; - mStartSel = aSelState; - mEditorBase = aEditorBase; - return NS_OK; -} - -NS_IMETHODIMP PlaceholderTransaction::DoTransaction() { return NS_OK; |