summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r--sc/source/ui/undo/refundo.cxx9
-rw-r--r--sc/source/ui/undo/undocell.cxx6
-rw-r--r--sc/source/ui/undo/undodat.cxx14
3 files changed, 14 insertions, 15 deletions
diff --git a/sc/source/ui/undo/refundo.cxx b/sc/source/ui/undo/refundo.cxx
index 7488465e63af..857120cc69da 100644
--- a/sc/source/ui/undo/refundo.cxx
+++ b/sc/source/ui/undo/refundo.cxx
@@ -80,7 +80,6 @@ ScRefUndoData::~ScRefUndoData()
delete pDetOpList;
delete pChartListenerCollection;
delete pAreaLinks;
- delete pUnoRefs;
}
void ScRefUndoData::DeleteUnchanged( const ScDocument* pDoc )
@@ -140,7 +139,7 @@ void ScRefUndoData::DeleteUnchanged( const ScDocument* pDoc )
pUnoRefs = const_cast<ScDocument*>(pDoc)->EndUnoRefUndo();
if ( pUnoRefs && pUnoRefs->IsEmpty() )
{
- DELETEZ( pUnoRefs );
+ pUnoRefs.reset();
}
}
}
@@ -148,9 +147,9 @@ void ScRefUndoData::DeleteUnchanged( const ScDocument* pDoc )
void ScRefUndoData::DoUndo( ScDocument* pDoc, bool bUndoRefFirst )
{
if (pDBCollection)
- pDoc->SetDBCollection( new ScDBCollection(*pDBCollection) );
+ pDoc->SetDBCollection( std::unique_ptr<ScDBCollection>(new ScDBCollection(*pDBCollection)) );
if (pRangeName)
- pDoc->SetRangeName( new ScRangeName(*pRangeName) );
+ pDoc->SetRangeName( std::unique_ptr<ScRangeName>(new ScRangeName(*pRangeName)) );
if (pPrintRanges)
pDoc->RestorePrintRanges(*pPrintRanges);
@@ -163,7 +162,7 @@ void ScRefUndoData::DoUndo( ScDocument* pDoc, bool bUndoRefFirst )
}
if (pDetOpList)
- pDoc->SetDetOpList( new ScDetOpList(*pDetOpList) );
+ pDoc->SetDetOpList( std::unique_ptr<ScDetOpList>(new ScDetOpList(*pDetOpList)) );
// bUndoRefFirst is bSetChartRangeLists
if ( pChartListenerCollection )
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 522914ec9cdc..9e8e09a1bb6f 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -912,7 +912,7 @@ void ScUndoDetective::Undo()
if (bIsDelete)
{
if ( pOldList )
- rDoc.SetDetOpList( new ScDetOpList(*pOldList) );
+ rDoc.SetDetOpList( std::unique_ptr<ScDetOpList>(new ScDetOpList(*pOldList)) );
}
else
{
@@ -999,14 +999,14 @@ void ScUndoRangeNames::DoChange( bool bUndo )
if (mnTab >= 0)
rDoc.SetRangeName( mnTab, new ScRangeName( *pOldRanges ) );
else
- rDoc.SetRangeName( new ScRangeName( *pOldRanges ) );
+ rDoc.SetRangeName( std::unique_ptr<ScRangeName>(new ScRangeName( *pOldRanges )) );
}
else
{
if (mnTab >= 0)
rDoc.SetRangeName( mnTab, new ScRangeName( *pNewRanges ) );
else
- rDoc.SetRangeName( new ScRangeName( *pNewRanges ) );
+ rDoc.SetRangeName( std::unique_ptr<ScRangeName>(new ScRangeName( *pNewRanges )) );
}
rDoc.CompileHybridFormula();
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index d3cef474a5d0..afaed1811b1e 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -656,9 +656,9 @@ void ScUndoSubTotals::Undo()
aParam.nCol2,aParam.nRow2,nTab );
if (xUndoRange)
- rDoc.SetRangeName(new ScRangeName(*xUndoRange));
+ rDoc.SetRangeName(std::unique_ptr<ScRangeName>(new ScRangeName(*xUndoRange)));
if (xUndoDB)
- rDoc.SetDBCollection(new ScDBCollection(*xUndoDB), true);
+ rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB)), true);
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )
@@ -796,7 +796,7 @@ void ScUndoQuery::Undo()
InsertDeleteFlags::NONE, false, rDoc);
if (xUndoDB)
- rDoc.SetDBCollection(new ScDBCollection(*xUndoDB ), true);
+ rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB )), true);
if (!bCopy)
{
@@ -980,7 +980,7 @@ void ScUndoDBData::Undo()
bool bOldAutoCalc = rDoc.GetAutoCalc();
rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
rDoc.PreprocessDBDataUpdate();
- rDoc.SetDBCollection( new ScDBCollection(*pUndoColl), true );
+ rDoc.SetDBCollection( std::unique_ptr<ScDBCollection>(new ScDBCollection(*pUndoColl)), true );
rDoc.CompileHybridFormula();
rDoc.SetAutoCalc( bOldAutoCalc );
@@ -998,7 +998,7 @@ void ScUndoDBData::Redo()
bool bOldAutoCalc = rDoc.GetAutoCalc();
rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
rDoc.PreprocessDBDataUpdate();
- rDoc.SetDBCollection( new ScDBCollection(*pRedoColl), true );
+ rDoc.SetDBCollection( std::unique_ptr<ScDBCollection>(new ScDBCollection(*pRedoColl)), true );
rDoc.CompileHybridFormula();
rDoc.SetAutoCalc( bOldAutoCalc );
@@ -1333,9 +1333,9 @@ void ScUndoRepeatDB::Undo()
aBlockEnd.Col(),aBlockEnd.Row(),nTab );
if (xUndoRange)
- rDoc.SetRangeName(new ScRangeName(*xUndoRange));
+ rDoc.SetRangeName(std::unique_ptr<ScRangeName>(new ScRangeName(*xUndoRange)));
if (xUndoDB)
- rDoc.SetDBCollection(new ScDBCollection(*xUndoDB), true);
+ rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB)), true);
SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
if ( nVisTab != nTab )