summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo/undotab.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-28 10:37:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-29 08:37:23 +0200
commitf5772b154d0c806ef029f1feee1ee92537eec463 (patch)
tree6b71a6af653d2a7b7f309d0ad4521177c3b16c01 /sc/source/ui/undo/undotab.cxx
parent286461d872057ab8110d9713c5cbe859448dda70 (diff)
loplugin:useuniqueptr in various ScUndo*
Change-Id: I604d7b900836e87fc768e1b00dc62a570ff477b5 Reviewed-on: https://gerrit.libreoffice.org/56619 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/undo/undotab.cxx')
-rw-r--r--sc/source/ui/undo/undotab.cxx48
1 files changed, 24 insertions, 24 deletions
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 8746136dc2fc..689f61b43142 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -68,13 +68,13 @@ ScUndoInsertTab::ScUndoInsertTab( ScDocShell* pNewDocShell,
nTab( nTabNum ),
bAppend( bApp )
{
- pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ).release();
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
SetChangeTrack();
}
ScUndoInsertTab::~ScUndoInsertTab()
{
- delete pDrawUndo;
+ pDrawUndo.reset();
}
OUString ScUndoInsertTab::GetComment() const
@@ -109,7 +109,7 @@ void ScUndoInsertTab::Undo()
bDrawIsInUndo = false;
pDocShell->SetInUndo( false ); //! EndUndo
- DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() );
+ DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() );
ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
@@ -123,7 +123,7 @@ void ScUndoInsertTab::Redo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
+ RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
pDocShell->SetInUndo( true ); //! BeginRedo
bDrawIsInUndo = true;
@@ -160,14 +160,14 @@ ScUndoInsertTables::ScUndoInsertTables( ScDocShell* pNewDocShell,
aNameList( newNameList ),
nTab( nTabNum )
{
- pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ).release();
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
SetChangeTrack();
}
ScUndoInsertTables::~ScUndoInsertTables()
{
- delete pDrawUndo;
+ pDrawUndo.reset();
}
OUString ScUndoInsertTables::GetComment() const
@@ -208,7 +208,7 @@ void ScUndoInsertTables::Undo()
bDrawIsInUndo = false;
pDocShell->SetInUndo( false ); //! EndUndo
- DoSdrUndoAction( pDrawUndo, &pDocShell->GetDocument() );
+ DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() );
ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
if ( pChangeTrack )
@@ -222,7 +222,7 @@ void ScUndoInsertTables::Redo()
{
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
- RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
+ RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
pDocShell->SetInUndo( true ); //! BeginRedo
bDrawIsInUndo = true;
@@ -277,7 +277,7 @@ void ScUndoDeleteTab::SetChangeTrack()
{
aRange.aStart.SetTab( theTabs[i] );
aRange.aEnd.SetTab( theTabs[i] );
- pChangeTrack->AppendDeleteRange( aRange, pRefUndoDoc,
+ pChangeTrack->AppendDeleteRange( aRange, pRefUndoDoc.get(),
nTmpChangeAction, nEndChangeAction, static_cast<short>(i) );
}
}
@@ -377,7 +377,7 @@ void ScUndoDeleteTab::Redo()
ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
pViewShell->SetTabNo( lcl_GetVisibleTabBefore( pDocShell->GetDocument(), theTabs.front() ) );
- RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
+ RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
pDocShell->SetInUndo( true ); //! BeginRedo
bDrawIsInUndo = true;
@@ -575,7 +575,7 @@ ScUndoCopyTab::ScUndoCopyTab(
mpNewNames(pNewNames),
pDrawUndo( nullptr )
{
- pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ).release();
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
if (mpNewNames && mpNewTabs->size() != mpNewNames->size())
// The sizes differ. Something is wrong.
@@ -584,7 +584,7 @@ ScUndoCopyTab::ScUndoCopyTab(
ScUndoCopyTab::~ScUndoCopyTab()
{
- delete pDrawUndo;
+ pDrawUndo.reset();
}
OUString ScUndoCopyTab::GetComment() const
@@ -610,7 +610,7 @@ void ScUndoCopyTab::Undo()
{
ScDocument& rDoc = pDocShell->GetDocument();
- DoSdrUndoAction( pDrawUndo, &rDoc ); // before the sheets are deleted
+ DoSdrUndoAction( pDrawUndo.get(), &rDoc ); // before the sheets are deleted
vector<SCTAB>::const_reverse_iterator itr, itrEnd = mpNewTabs->rend();
for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
@@ -687,7 +687,7 @@ void ScUndoCopyTab::Redo()
}
}
- RedoSdrUndoAction( pDrawUndo ); // after the sheets are inserted
+ RedoSdrUndoAction( pDrawUndo.get() ); // after the sheets are inserted
pViewShell->SetTabNo( nDestTab, true ); // after draw-undo
@@ -786,12 +786,12 @@ ScUndoMakeScenario::ScUndoMakeScenario( ScDocShell* pNewDocShell,
nFlags( nF ),
pDrawUndo( nullptr )
{
- pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ).release();
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoMakeScenario::~ScUndoMakeScenario()
{
- delete pDrawUndo;
+ pDrawUndo.reset();
}
OUString ScUndoMakeScenario::GetComment() const
@@ -809,7 +809,7 @@ void ScUndoMakeScenario::Undo()
bDrawIsInUndo = false;
pDocShell->SetInUndo( false );
- DoSdrUndoAction( pDrawUndo, &rDoc );
+ DoSdrUndoAction( pDrawUndo.get(), &rDoc );
pDocShell->PostPaint(0,0,nDestTab,MAXCOL,MAXROW,MAXTAB, PaintPartFlags::All);
pDocShell->PostDataChanged();
@@ -828,7 +828,7 @@ void ScUndoMakeScenario::Redo()
{
SetViewMarkData(*mpMarkData);
- RedoSdrUndoAction( pDrawUndo ); // Draw Redo first
+ RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
pDocShell->SetInUndo( true );
bDrawIsInUndo = true;
@@ -865,12 +865,12 @@ ScUndoImportTab::ScUndoImportTab(ScDocShell* pShell,
, nCount(nNewCount)
, pDrawUndo(nullptr)
{
- pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() ).release();
+ pDrawUndo = GetSdrUndoAction( &pDocShell->GetDocument() );
}
ScUndoImportTab::~ScUndoImportTab()
{
- delete pDrawUndo;
+ pDrawUndo.reset();
}
OUString ScUndoImportTab::GetComment() const
@@ -942,7 +942,7 @@ void ScUndoImportTab::Undo()
}
- DoSdrUndoAction( pDrawUndo, &rDoc ); // before the sheets are deleted
+ DoSdrUndoAction( pDrawUndo.get(), &rDoc ); // before the sheets are deleted
bDrawIsInUndo = true;
for (i=0; i<nCount; i++)
@@ -995,7 +995,7 @@ void ScUndoImportTab::Redo()
rDoc.SetTabProtection(nTabPos, xRedoDoc->GetTabProtection(nTabPos));
}
- RedoSdrUndoAction( pDrawUndo ); // after the sheets are inserted
+ RedoSdrUndoAction( pDrawUndo.get() ); // after the sheets are inserted
DoChange();
}
@@ -1304,8 +1304,8 @@ ScUndoPrintRange::ScUndoPrintRange( ScDocShell* pShell, SCTAB nNewTab,
ScUndoPrintRange::~ScUndoPrintRange()
{
- delete pOldRanges;
- delete pNewRanges;
+ pOldRanges.reset();
+ pNewRanges.reset();
}
void ScUndoPrintRange::DoChange(bool bUndo)