diff options
Diffstat (limited to 'sc/source/ui/docshell/docfunc.cxx')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index fcd7af66e640..4b6fbe44e8c5 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -103,14 +103,14 @@ using namespace com::sun::star; using ::std::vector; -IMPL_LINK( ScDocFunc, NotifyDrawUndo, SdrUndoAction*, pUndoAction, void ) +void ScDocFunc::NotifyDrawUndo( std::unique_ptr<SdrUndoAction> pUndoAction) { // #i101118# if drawing layer collects the undo actions, add it there ScDrawLayer* pDrawLayer = rDocShell.GetDocument().GetDrawLayer(); if( pDrawLayer && pDrawLayer->IsRecording() ) - pDrawLayer->AddCalcUndo( pUndoAction ); + pDrawLayer->AddCalcUndo( std::move(pUndoAction) ); else - rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( pUndoAction, &rDocShell ) ); + rDocShell.GetUndoManager()->AddUndoAction( new ScUndoDraw( std::move(pUndoAction), &rDocShell ) ); rDocShell.SetDrawModified(); // the affected sheet isn't known, so all stream positions are invalidated @@ -191,7 +191,7 @@ bool ScDocFunc::DetectiveAddPred(const ScAddress& rPos) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), &aOperation ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), &aOperation ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -230,7 +230,7 @@ bool ScDocFunc::DetectiveDelPred(const ScAddress& rPos) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), &aOperation ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), &aOperation ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -267,7 +267,7 @@ bool ScDocFunc::DetectiveAddSucc(const ScAddress& rPos) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), &aOperation ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), &aOperation ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -306,7 +306,7 @@ bool ScDocFunc::DetectiveDelSucc(const ScAddress& rPos) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), &aOperation ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), &aOperation ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -343,7 +343,7 @@ bool ScDocFunc::DetectiveAddError(const ScAddress& rPos) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), &aOperation ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), &aOperation ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -425,7 +425,7 @@ bool ScDocFunc::DetectiveDelAll(SCTAB nTab) if (bUndo) { rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDetective( &rDocShell, pUndo.release(), nullptr, std::move(pUndoList) ) ); + new ScUndoDetective( &rDocShell, std::move(pUndo), nullptr, std::move(pUndoList) ) ); } aModificator.SetDocumentModified(); SfxBindings* pBindings = rDocShell.GetViewBindings(); @@ -496,7 +496,7 @@ bool ScDocFunc::DetectiveRefresh( bool bAutomatic ) pUndo->SetComment( ScResId( STR_UNDO_DETREFRESH ) ); // associate with the last action rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoDraw( pUndo.release(), &rDocShell ), + new ScUndoDraw( std::move(pUndo), &rDocShell ), bAutomatic ); } } @@ -1284,7 +1284,7 @@ void ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c // create the undo action if( pUndoMgr && (aOldData.m_pCaption || aNewData.m_pCaption) ) - pUndoMgr->AddUndoAction( new ScUndoReplaceNote( rDocShell, rPos, aOldData, aNewData, pDrawLayer->GetCalcUndo().release() ) ); + pUndoMgr->AddUndoAction( new ScUndoReplaceNote( rDocShell, rPos, aOldData, aNewData, pDrawLayer->GetCalcUndo() ) ); // repaint cell (to make note marker visible) rDocShell.PostPaintCell( rPos ); @@ -4876,7 +4876,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo { std::unique_ptr<SdrUndoGroup> pDrawUndo = rDoc.GetDrawLayer() ? rDoc.GetDrawLayer()->GetCalcUndo() : nullptr; rDocShell.GetUndoManager()->AddUndoAction( - new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, std::move(pUndoDoc), pDrawUndo.release()) ); + new ScUndoMerge(&rDocShell, rOption, bNeedContentsUndo, std::move(pUndoDoc), std::move(pDrawUndo)) ); } aModificator.SetDocumentModified(); |