diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-30 13:54:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-03 08:27:48 +0200 |
commit | 6be7e2e9dd8027d284f1b00ef6e3b4654eec7d79 (patch) | |
tree | d43e18e7ef12d29089f9eb34bbe95a78245261cc /sc/source/ui/view/viewfun3.cxx | |
parent | dff829e863fd05bedd5bcb713cd80c10fa582932 (diff) |
pass SdrUndoAction around by std::unique_ptr
convert the LINK we use here to std::function, since LINK
does not currently handle std::unique_ptr
Change-Id: I9df80352e612445e5f5ca513d7d4196d65589778
Reviewed-on: https://gerrit.libreoffice.org/59804
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 | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 7ae86f3d0c93..e02a4d44a1d4 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -1411,20 +1411,20 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, aOptions.bAsLink = bAsLink; aOptions.eMoveMode = eMoveMode; - SfxUndoAction* pUndo = new ScUndoPaste( + std::unique_ptr<SfxUndoAction> pUndo(new ScUndoPaste( pDocSh, ScRange(nStartCol, nStartRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab), aFilteredMark, std::move(pUndoDoc), std::move(pRedoDoc), nFlags | nUndoFlags, std::move(pUndoData), - false, &aOptions ); // false = Redo data not yet copied + false, &aOptions )); // false = Redo data not yet copied if ( bInsertCells ) { // 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( pUndo ), true ); + pUndoMgr->AddUndoAction( new ScUndoWrapper( std::move(pUndo) ), true ); } else - pUndoMgr->AddUndoAction( pUndo ); + pUndoMgr->AddUndoAction( pUndo.release() ); pUndoMgr->LeaveListAction(); } @@ -1610,13 +1610,13 @@ bool ScViewFunc::PasteMultiRangesFromClip( aOptions.bAsLink = bAsLink; aOptions.eMoveMode = eMoveMode; - ScUndoPaste* pUndo = new ScUndoPaste(pDocSh, - aMarkedRange, aMark, std::move(pUndoDoc), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions); + std::unique_ptr<ScUndoPaste> pUndo(new ScUndoPaste(pDocSh, + aMarkedRange, aMark, std::move(pUndoDoc), nullptr, nFlags|nUndoFlags, nullptr, false, &aOptions)); if (bInsertCells) - pUndoMgr->AddUndoAction(new ScUndoWrapper(pUndo), true); + pUndoMgr->AddUndoAction(new ScUndoWrapper(std::move(pUndo)), true); else - pUndoMgr->AddUndoAction(pUndo); + pUndoMgr->AddUndoAction(pUndo.release()); pUndoMgr->LeaveListAction(); } @@ -1994,12 +1994,12 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , } } pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nCurrentRow, nStartTab, nEndCol, nCurrentRow, nEndTab ); // content after the change - SfxUndoAction* pUndo = new ScUndoDataForm( pDocSh, + std::unique_ptr<SfxUndoAction> pUndo( new ScUndoDataForm( pDocSh, nStartCol, nCurrentRow, nStartTab, nUndoEndCol, nUndoEndRow, nEndTab, rMark, std::move(pUndoDoc), std::move(pRedoDoc), - std::move(pUndoData) ); - pUndoMgr->AddUndoAction( new ScUndoWrapper( pUndo ), true ); + std::move(pUndoData) ) ); + pUndoMgr->AddUndoAction( new ScUndoWrapper( std::move(pUndo) ), true ); PaintPartFlags nPaint = PaintPartFlags::Grid; if (bColInfo) |