diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-06 14:54:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-07 08:48:37 +0200 |
commit | 9e17d32da3cec059f9f994d502ff67dbcbf3bb50 (patch) | |
tree | 6bb69a9e13fd463722fe2c72de766d06307ff033 /editeng | |
parent | 6c96bc3cbe109c97cddda9b357c1857fbcb4700c (diff) |
loplugin:useuniqueptr in ImpEditEngine
Change-Id: I9799c1b239a23fc0f497132ddf29f69c73b1529f
Reviewed-on: https://gerrit.libreoffice.org/60115
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 08951792e149..ab454ad703f1 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -451,7 +451,7 @@ private: std::unique_ptr<SfxItemSet> pEmptyItemSet; EditUndoManager* pUndoManager; - ESelection* pUndoMarkSelection; + std::unique_ptr<ESelection> pUndoMarkSelection; std::unique_ptr<ImplIMEInfos> mpIMEInfos; diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 2b5f4b391b83..109450adbd9e 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -242,7 +242,7 @@ void ImpEditEngine::UndoActionStart( sal_uInt16 nId, const ESelection& aSel ) { GetUndoManager().EnterListAction( GetEditEnginePtr()->GetUndoComment( nId ), OUString(), nId, CreateViewShellId() ); DBG_ASSERT( !pUndoMarkSelection, "UndoAction SelectionMarker?" ); - pUndoMarkSelection = new ESelection( aSel ); + pUndoMarkSelection.reset(new ESelection( aSel )); } } @@ -260,8 +260,7 @@ void ImpEditEngine::UndoActionEnd() if ( IsUndoEnabled() && !IsInUndo() ) { GetUndoManager().LeaveListAction(); - delete pUndoMarkSelection; - pUndoMarkSelection = nullptr; + pUndoMarkSelection.reset(); } } @@ -272,8 +271,7 @@ void ImpEditEngine::InsertUndo( EditUndo* pUndo, bool bTryMerge ) { EditUndoMarkSelection* pU = new EditUndoMarkSelection(pEditEngine, *pUndoMarkSelection); GetUndoManager().AddUndoAction( pU ); - delete pUndoMarkSelection; - pUndoMarkSelection = nullptr; + pUndoMarkSelection.reset(); } GetUndoManager().AddUndoAction( pUndo, bTryMerge ); |