diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-24 14:27:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-25 10:59:37 +0200 |
commit | 6ae4c85fe6c1bdd009b494382ac2ca2584307801 (patch) | |
tree | 8d04ef513bb495922594c0514fe530fa731affc8 /sc/source/ui/view/viewfunc.cxx | |
parent | 7413216e02be9b2f8eb39d550c297021e92ef299 (diff) |
loplugin:useuniqueptr in ScMoveUndo
Change-Id: I622a0f37866c5ea1f4ec5f4475d784682a0179c2
Reviewed-on: https://gerrit.libreoffice.org/59560
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/viewfunc.cxx')
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 818ef89ab361..e433d96fd2ab 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1820,11 +1820,11 @@ void ScViewFunc::DeleteMulti( bool bRows ) WaitObject aWait( GetFrameWin() ); // important for TrackFormulas in UpdateReference - ScDocument* pUndoDoc = nullptr; + ScDocumentUniquePtr pUndoDoc; ScRefUndoData* pUndoData = nullptr; if (bRecord) { - pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); + pUndoDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pUndoDoc->InitUndo( &rDoc, nTab, nTab, !bRows, bRows ); // row height for (sc::ColRowSpan & rSpan : aSpans) @@ -1877,7 +1877,7 @@ void ScViewFunc::DeleteMulti( bool bRows ) { pDocSh->GetUndoManager()->AddUndoAction( new ScUndoDeleteMulti( - pDocSh, bRows, bNeedRefresh, nTab, aSpans, pUndoDoc, pUndoData)); + pDocSh, bRows, bNeedRefresh, nTab, aSpans, std::move(pUndoDoc), pUndoData)); } if (!AdjustRowHeight(0, MAXROW)) |