summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo
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/undo
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/undo')
-rw-r--r--sc/source/ui/undo/undobase.cxx4
-rw-r--r--sc/source/ui/undo/undoblk3.cxx4
-rw-r--r--sc/source/ui/undo/undocell.cxx12
-rw-r--r--sc/source/ui/undo/undodraw.cxx4
4 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx
index 4d041ac4ad5b..af5d6fd22a6d 100644
--- a/sc/source/ui/undo/undobase.cxx
+++ b/sc/source/ui/undo/undobase.cxx
@@ -552,8 +552,8 @@ void ScDBFuncUndo::EndRedo()
ScSimpleUndo::EndRedo();
}
-ScUndoWrapper::ScUndoWrapper( SfxUndoAction* pUndo ) :
- pWrappedUndo( pUndo ),
+ScUndoWrapper::ScUndoWrapper( std::unique_ptr<SfxUndoAction> pUndo ) :
+ pWrappedUndo( std::move(pUndo) ),
mnViewShellId( -1 )
{
if (pWrappedUndo)
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index d90b65195a90..57dedac42731 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -637,12 +637,12 @@ bool ScUndoAutoFill::CanRepeat(SfxRepeatTarget& rTarget) const
}
ScUndoMerge::ScUndoMerge(ScDocShell* pNewDocShell, const ScCellMergeOption& rOption,
- bool bMergeContents, ScDocumentUniquePtr pUndoDoc, SdrUndoAction* pDrawUndo)
+ bool bMergeContents, ScDocumentUniquePtr pUndoDoc, std::unique_ptr<SdrUndoAction> pDrawUndo)
: ScSimpleUndo(pNewDocShell)
, maOption(rOption)
, mbMergeContents(bMergeContents)
, mxUndoDoc(std::move(pUndoDoc))
- , mpDrawUndo(pDrawUndo)
+ , mpDrawUndo(std::move(pDrawUndo))
{
}
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 6deea5b1fb50..afb2d471838a 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -885,10 +885,10 @@ OUString ScUndoNewSdrCaptionObj::GetComment() const
}
ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos,
- const ScNoteData& rNoteData, bool bInsert, SdrUndoAction* pDrawUndo ) :
+ const ScNoteData& rNoteData, bool bInsert, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
ScSimpleUndo( &rDocShell ),
maPos( rPos ),
- mpDrawUndo( pDrawUndo )
+ mpDrawUndo( std::move(pDrawUndo) )
{
OSL_ENSURE( rNoteData.m_pCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" );
if (bInsert)
@@ -902,12 +902,12 @@ ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rP
}
ScUndoReplaceNote::ScUndoReplaceNote( ScDocShell& rDocShell, const ScAddress& rPos,
- const ScNoteData& rOldData, const ScNoteData& rNewData, SdrUndoAction* pDrawUndo ) :
+ const ScNoteData& rOldData, const ScNoteData& rNewData, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
ScSimpleUndo( &rDocShell ),
maPos( rPos ),
maOldData( rOldData ),
maNewData( rNewData ),
- mpDrawUndo( pDrawUndo )
+ mpDrawUndo( std::move(pDrawUndo) )
{
OSL_ENSURE( maOldData.m_pCaption || maNewData.m_pCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" );
OSL_ENSURE( !maOldData.mxInitData.get() && !maNewData.mxInitData.get(), "ScUndoReplaceNote::ScUndoReplaceNote - unexpected uninitialized note" );
@@ -1031,12 +1031,12 @@ OUString ScUndoShowHideNote::GetComment() const
}
ScUndoDetective::ScUndoDetective( ScDocShell* pNewDocShell,
- SdrUndoAction* pDraw, const ScDetOpData* pOperation,
+ std::unique_ptr<SdrUndoAction> pDraw, const ScDetOpData* pOperation,
std::unique_ptr<ScDetOpList> pUndoList ) :
ScSimpleUndo( pNewDocShell ),
pOldList ( std::move(pUndoList) ),
nAction ( 0 ),
- pDrawUndo ( pDraw )
+ pDrawUndo ( std::move(pDraw) )
{
bIsDelete = ( pOperation == nullptr );
if (!bIsDelete)
diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx
index 83229f81978d..ce00e84c811e 100644
--- a/sc/source/ui/undo/undodraw.cxx
+++ b/sc/source/ui/undo/undodraw.cxx
@@ -24,8 +24,8 @@
#include <tabvwsh.hxx>
-ScUndoDraw::ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ) :
- pDrawUndo( pUndo ),
+ScUndoDraw::ScUndoDraw( std::unique_ptr<SfxUndoAction> pUndo, ScDocShell* pDocSh ) :
+ pDrawUndo( std::move(pUndo) ),
pDocShell( pDocSh ),
mnViewShellId( -1 )
{