summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/PlaceholderTransaction.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/libeditor/PlaceholderTransaction.h')
-rw-r--r--editor/libeditor/PlaceholderTransaction.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/editor/libeditor/PlaceholderTransaction.h b/editor/libeditor/PlaceholderTransaction.h
index 8193239be..5fa58a1e9 100644
--- a/editor/libeditor/PlaceholderTransaction.h
+++ b/editor/libeditor/PlaceholderTransaction.h
@@ -8,12 +8,13 @@
#include "EditAggregateTransaction.h"
#include "mozilla/EditorUtils.h"
+#include "mozilla/UniquePtr.h"
+#include "mozilla/WeakPtr.h"
#include "nsIAbsorbingTransaction.h"
#include "nsIDOMNode.h"
#include "nsCOMPtr.h"
#include "nsWeakPtr.h"
#include "nsWeakReference.h"
-#include "nsAutoPtr.h"
namespace mozilla {
@@ -26,14 +27,18 @@ class CompositionTransaction;
* transactions it has absorbed.
*/
-class PlaceholderTransaction final : public EditAggregateTransaction,
- public nsIAbsorbingTransaction,
- public nsSupportsWeakReference
+class PlaceholderTransaction final
+ : public EditAggregateTransaction
+ , public nsIAbsorbingTransaction
+ , public SupportsWeakPtr<PlaceholderTransaction>
{
public:
+ MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PlaceholderTransaction)
+
NS_DECL_ISUPPORTS_INHERITED
- PlaceholderTransaction();
+ PlaceholderTransaction(EditorBase& aEditorBase, nsIAtom* aName,
+ UniquePtr<SelectionState> aSelState);
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PlaceholderTransaction,
EditAggregateTransaction)
@@ -46,9 +51,6 @@ public:
// ------------ nsIAbsorbingTransaction -----------------------
- NS_IMETHOD Init(nsIAtom* aName, SelectionState* aSelState,
- EditorBase* aEditorBase) override;
-
NS_IMETHOD GetTxnName(nsIAtom** aName) override;
NS_IMETHOD StartSelectionEquals(SelectionState* aSelState,
@@ -61,6 +63,11 @@ public:
NS_IMETHOD Commit() override;
+ NS_IMETHOD_(PlaceholderTransaction*) AsPlaceholderTransaction() override
+ {
+ return this;
+ }
+
nsresult RememberEndingSelection();
protected:
@@ -80,7 +87,7 @@ protected:
// restore the selection properly.
// Use a pointer because this is constructed before we exist.
- nsAutoPtr<SelectionState> mStartSel;
+ UniquePtr<SelectionState> mStartSel;
SelectionState mEndSel;
// The editor for this transaction.