summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docfunc.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-30 13:54:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-03 08:27:48 +0200
commit6be7e2e9dd8027d284f1b00ef6e3b4654eec7d79 (patch)
treed43e18e7ef12d29089f9eb34bbe95a78245261cc /sc/source/ui/docshell/docfunc.cxx
parentdff829e863fd05bedd5bcb713cd80c10fa582932 (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/docshell/docfunc.cxx')
-rw-r--r--sc/source/ui/docshell/docfunc.cxx24
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();