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/drawfunc | |
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/drawfunc')
-rw-r--r-- | sc/source/ui/drawfunc/drawsh5.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/futext3.cxx | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 8cd59b32e9ff..cc036a2bd5e4 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -522,7 +522,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) if(!aPersistName.isEmpty()) { pDocSh->GetUndoManager()->AddUndoAction( - new ScUndoRenameObject(pDocSh, aPersistName, pSelected->GetName(), aName)); + o3tl::make_unique<ScUndoRenameObject>(pDocSh, aPersistName, pSelected->GetName(), aName)); } } diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 2ea92dec0858..6ac928a06401 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -564,7 +564,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV if (bUndo) { pScDocSh->GetUndoManager()->AddUndoAction( - new ScUndoInsertTab( pScDocSh, nNewTab, + o3tl::make_unique<ScUndoInsertTab>( pScDocSh, nNewTab, true/*bAppend*/, aTabName ) ); } @@ -727,7 +727,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV { // add undo action the same way as in SdrEditView::InsertObjectAtView // (using UndoActionHdl etc.) - pView->AddUndo(new SdrUndoNewObj(*pObj)); + pView->AddUndo(o3tl::make_unique<SdrUndoNewObj>(*pObj)); } // BM/IHA -- diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index a6ffeb93e4ec..6f7431056b9f 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -92,9 +92,9 @@ void FuText::StopEditMode() // create a "insert note" undo action if needed if( bNewNote ) - pUndoMgr->AddUndoAction( new ScUndoReplaceNote( *pDocShell, aNotePos, pNote->GetNoteData(), true, std::move(pCalcUndo) ) ); + pUndoMgr->AddUndoAction( o3tl::make_unique<ScUndoReplaceNote>( *pDocShell, aNotePos, pNote->GetNoteData(), true, std::move(pCalcUndo) ) ); else - pUndoMgr->AddUndoAction( pCalcUndo.release() ); + pUndoMgr->AddUndoAction( std::move(pCalcUndo) ); } } @@ -143,7 +143,7 @@ void FuText::StopEditMode() // delete note from document (removes caption, but does not delete it) rDoc.ReleaseNote(aNotePos); // create undo action for removed note - pUndoMgr->AddUndoAction( new ScUndoReplaceNote( *pDocShell, aNotePos, aNoteData, false, pDrawLayer->GetCalcUndo() ) ); + pUndoMgr->AddUndoAction( o3tl::make_unique<ScUndoReplaceNote>( *pDocShell, aNotePos, aNoteData, false, pDrawLayer->GetCalcUndo() ) ); } else { |