mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Bug 1337698 - Use UniquePtr instead of nsAutoPtr in editor
* PlaceholderTransaction should use UniquePtr * HTMLEditor should use UniquePtr * TypeInState should use UniquePtr Tag #1375
This commit is contained in:
parent
6aa436b588
commit
32e4ad01e3
10 changed files with 32 additions and 44 deletions
|
|
@ -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()
|
||||
|
|
@ -56,19 +62,6 @@ NS_INTERFACE_MAP_END_INHERITING(EditAggregateTransaction)
|
|||
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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue