diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-08 11:22:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-09 12:09:55 +0200 |
commit | f7ce839c7844f029c0a1ac83a5638e83356b4c4b (patch) | |
tree | c93a342a577133b384a3ccc088d7d0675d4fb9e3 /sc/source/ui/view/viewfun3.cxx | |
parent | 4ba06560e33f17ca1ed72ad722c80eae5ffd4277 (diff) |
use unique_ptr in SfxUndoManager::AddUndoAction
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15
Reviewed-on: https://gerrit.libreoffice.org/61566
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/viewfun3.cxx')
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index e02a4d44a1d4..6565b0a7b042 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -139,7 +139,7 @@ void ScViewFunc::CutToClip() if ( bRecord ) // Draw-Undo now available pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoCut( pDocSh, aRange, aOldEnd, rMark, std::move(pUndoDoc) ) ); + o3tl::make_unique<ScUndoCut>( pDocSh, aRange, aOldEnd, rMark, std::move(pUndoDoc) ) ); aModificator.SetDocumentModified(); pDocSh->UpdateOle(&GetViewData()); @@ -1421,10 +1421,10 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, // Merge the paste undo action into the insert action. // Use ScUndoWrapper so the ScUndoPaste pointer can be stored in the insert action. - pUndoMgr->AddUndoAction( new ScUndoWrapper( std::move(pUndo) ), true ); + pUndoMgr->AddUndoAction( o3tl::make_unique<ScUndoWrapper>( std::move(pUndo) ), true ); } else - pUndoMgr->AddUndoAction( pUndo.release() ); + pUndoMgr->AddUndoAction( std::move(pUndo) ); pUndoMgr->LeaveListAction(); } @@ -1614,9 +1614,9 @@ bool ScViewFunc::PasteMultiRangesFromClip( aMarkedRange, aMark, std::move(pUndoDoc), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions)); if (bInsertCells) - pUndoMgr->AddUndoAction(new ScUndoWrapper(std::move(pUndo)), true); + pUndoMgr->AddUndoAction(o3tl::make_unique<ScUndoWrapper>(std::move(pUndo)), true); else - pUndoMgr->AddUndoAction(pUndo.release()); + pUndoMgr->AddUndoAction(std::move(pUndo)); pUndoMgr->LeaveListAction(); } @@ -1775,10 +1775,10 @@ bool ScViewFunc::PasteFromClipToMultiRanges( aOptions.bAsLink = bAsLink; aOptions.eMoveMode = eMoveMode; - ScUndoPaste* pUndo = new ScUndoPaste( - pDocSh, aRanges, aMark, std::move(pUndoDoc), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions); - pUndoMgr->AddUndoAction(pUndo); + pUndoMgr->AddUndoAction( + o3tl::make_unique<ScUndoPaste>( + pDocSh, aRanges, aMark, std::move(pUndoDoc), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions)); pUndoMgr->LeaveListAction(); } @@ -1999,7 +1999,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , nUndoEndCol, nUndoEndRow, nEndTab, rMark, std::move(pUndoDoc), std::move(pRedoDoc), std::move(pUndoData) ) ); - pUndoMgr->AddUndoAction( new ScUndoWrapper( std::move(pUndo) ), true ); + pUndoMgr->AddUndoAction( o3tl::make_unique<ScUndoWrapper>( std::move(pUndo) ), true ); PaintPartFlags nPaint = PaintPartFlags::Grid; if (bColInfo) |