summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-13 10:43:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-14 08:58:15 +0200
commite1beb569ff54c2b9dde6dd442c6ea1cc53a03222 (patch)
tree5cde6803b368d81b2fb6c716255a6e0c3da0727e
parent761308edb65a6cf44ef84cebc387e77af8b70f83 (diff)
loplugin:useuniqueptr in DocumentContentOperationsManager::MoveNodeRange
Change-Id: I2e32dba4ad9770ed62dbf74769ee00c05235bd40 Reviewed-on: https://gerrit.libreoffice.org/60445 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 52e67c6d0146..ed75cefaabc7 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2249,9 +2249,9 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod
// Set it to before the Position, so that it cannot be moved further.
SwNodeIndex aIdx( rPos, -1 );
- SwNodeIndex* pSaveInsPos = nullptr;
+ std::unique_ptr<SwNodeIndex> pSaveInsPos;
if( pUndo )
- pSaveInsPos = new SwNodeIndex( rRange.aStart, -1 );
+ pSaveInsPos.reset(new SwNodeIndex( rRange.aStart, -1 ));
// move the Nodes
bool bNoDelFrames = bool(SwMoveFlags::NO_DELFRMS & eMvFlags);
@@ -2302,7 +2302,7 @@ bool DocumentContentOperationsManager::MoveNodeRange( SwNodeRange& rRange, SwNod
m_rDoc.GetIDocumentUndoRedo().AppendUndo(pUndo);
}
- delete pSaveInsPos;
+ pSaveInsPos.reset();
if( bUpdateFootnote )
{