diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-17 10:11:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-19 05:39:18 +0000 |
commit | 9767537e22e178eb23872de138ea70e57c1a6725 (patch) | |
tree | 5abf4eee091215affc75477b08def703188de513 /sc/source/ui/undo | |
parent | tdf#35021 TAB_OVER_MARGIN pdf support for left/center/dec (diff) | |
download | core-9767537e22e178eb23872de138ea70e57c1a6725.tar.gz core-9767537e22e178eb23872de138ea70e57c1a6725.zip |
new loplugin: useuniqueptr: sc part 2
Change-Id: I37936a297027313e2a8ae18f355567462955739e
Reviewed-on: https://gerrit.libreoffice.org/33203
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r-- | sc/source/ui/undo/undobase.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/undo/undodat.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/undo/undodraw.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/undo/undorangename.cxx | 1 |
6 files changed, 7 insertions, 32 deletions
diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 5ac882779ec3..c2b4b693ddfc 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -38,7 +38,6 @@ ScSimpleUndo::ScSimpleUndo( ScDocShell* pDocSh ) : pDocShell( pDocSh ), - pDetectiveUndo( nullptr ), mnViewShellId(-1) { if (ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell()) @@ -52,7 +51,6 @@ sal_Int32 ScSimpleUndo::GetViewShellId() const ScSimpleUndo::~ScSimpleUndo() { - delete pDetectiveUndo; } bool ScSimpleUndo::SetViewMarkData( const ScMarkData& rMarkData ) @@ -83,8 +81,7 @@ bool ScSimpleUndo::Merge( SfxUndoAction *pNextAction ) // ScUndoDraw is later deleted by the UndoManager ScUndoDraw* pCalcUndo = static_cast<ScUndoDraw*>(pNextAction); - pDetectiveUndo = pCalcUndo->GetDrawUndo(); - pCalcUndo->ForgetDrawUndo(); + pDetectiveUndo.reset( pCalcUndo->ReleaseDrawUndo() ); return true; } @@ -610,7 +607,6 @@ ScUndoWrapper::ScUndoWrapper( SfxUndoAction* pUndo ) : ScUndoWrapper::~ScUndoWrapper() { - delete pWrappedUndo; } void ScUndoWrapper::ForgetWrappedUndo() diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index 45c3ffb34b2b..39f604afeb98 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -738,7 +738,6 @@ ScUndoCut::ScUndoCut( ScDocShell* pNewDocShell, ScUndoCut::~ScUndoCut() { - delete pUndoDoc; } OUString ScUndoCut::GetComment() const @@ -750,7 +749,7 @@ void ScUndoCut::SetChangeTrack() { ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack(); if ( pChangeTrack ) - pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc, + pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc.get(), nStartChangeAction, nEndChangeAction, SC_CACM_CUT ); else nStartChangeAction = nEndChangeAction = 0; @@ -1560,7 +1559,6 @@ ScUndoUseScenario::ScUndoUseScenario( ScDocShell* pNewDocShell, ScUndoUseScenario::~ScUndoUseScenario() { - delete pUndoDoc; } OUString ScUndoUseScenario::GetComment() const @@ -1676,7 +1674,6 @@ ScUndoSelectionStyle::ScUndoSelectionStyle( ScDocShell* pNewDocShell, ScUndoSelectionStyle::~ScUndoSelectionStyle() { - delete pUndoDoc; } OUString ScUndoSelectionStyle::GetComment() const @@ -1781,7 +1778,6 @@ ScUndoEnterMatrix::ScUndoEnterMatrix( ScDocShell* pNewDocShell, const ScRange& r ScUndoEnterMatrix::~ScUndoEnterMatrix() { - delete pUndoDoc; } OUString ScUndoEnterMatrix::GetComment() const @@ -1794,7 +1790,7 @@ void ScUndoEnterMatrix::SetChangeTrack() ScDocument& rDoc = pDocShell->GetDocument(); ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); if ( pChangeTrack ) - pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc, + pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc.get(), nStartChangeAction, nEndChangeAction ); else nStartChangeAction = nEndChangeAction = 0; @@ -1875,7 +1871,6 @@ ScUndoIndent::ScUndoIndent( ScDocShell* pNewDocShell, const ScMarkData& rMark, ScUndoIndent::~ScUndoIndent() { - delete pUndoDoc; } OUString ScUndoIndent::GetComment() const @@ -1932,7 +1927,6 @@ ScUndoTransliterate::ScUndoTransliterate( ScDocShell* pNewDocShell, const ScMark ScUndoTransliterate::~ScUndoTransliterate() { - delete pUndoDoc; } OUString ScUndoTransliterate::GetComment() const @@ -2052,7 +2046,6 @@ ScUndoRemoveBreaks::ScUndoRemoveBreaks( ScDocShell* pNewDocShell, ScUndoRemoveBreaks::~ScUndoRemoveBreaks() { - delete pUndoDoc; } OUString ScUndoRemoveBreaks::GetComment() const @@ -2122,7 +2115,6 @@ ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell, ScUndoRemoveMerge::~ScUndoRemoveMerge() { - delete pUndoDoc; } OUString ScUndoRemoveMerge::GetComment() const @@ -2132,7 +2124,7 @@ OUString ScUndoRemoveMerge::GetComment() const ScDocument* ScUndoRemoveMerge::GetUndoDoc() { - return pUndoDoc; + return pUndoDoc.get(); } void ScUndoRemoveMerge::AddCellMergeOption( const ScCellMergeOption& rOption ) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 1d3d707bbaa5..226e15dcc44a 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -229,7 +229,6 @@ ScUndoFillTable::ScUndoFillTable( ScDocShell* pNewDocShell, ScUndoFillTable::~ScUndoFillTable() { - delete pUndoDoc; } OUString ScUndoFillTable::GetComment() const @@ -253,7 +252,7 @@ void ScUndoFillTable::SetChangeTrack() { aWorkRange.aStart.SetTab(*itr); aWorkRange.aEnd.SetTab(*itr); - pChangeTrack->AppendContentRange( aWorkRange, pUndoDoc, + pChangeTrack->AppendContentRange( aWorkRange, pUndoDoc.get(), nTmpAction, nEndChangeAction ); if ( !nStartChangeAction ) nStartChangeAction = nTmpAction; @@ -503,7 +502,6 @@ ScUndoAutoFill::ScUndoAutoFill( ScDocShell* pNewDocShell, ScUndoAutoFill::~ScUndoAutoFill() { - delete pUndoDoc; } OUString ScUndoAutoFill::GetComment() const @@ -515,7 +513,7 @@ void ScUndoAutoFill::SetChangeTrack() { ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack(); if ( pChangeTrack ) - pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc, + pChangeTrack->AppendContentRange( aBlockRange, pUndoDoc.get(), nStartChangeAction, nEndChangeAction ); else nStartChangeAction = nEndChangeAction = 0; @@ -776,7 +774,6 @@ ScUndoAutoFormat::ScUndoAutoFormat( ScDocShell* pNewDocShell, ScUndoAutoFormat::~ScUndoAutoFormat() { - delete pUndoDoc; } OUString ScUndoAutoFormat::GetComment() const @@ -1113,7 +1110,6 @@ ScUndoTabOp::ScUndoTabOp( ScDocShell* pNewDocShell, ScUndoTabOp::~ScUndoTabOp() { - delete pUndoDoc; } OUString ScUndoTabOp::GetComment() const diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index e78330161810..b6527a5faddd 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -65,7 +65,6 @@ ScUndoDoOutline::ScUndoDoOutline( ScDocShell* pNewDocShell, ScUndoDoOutline::~ScUndoDoOutline() { - delete pUndoDoc; } OUString ScUndoDoOutline::GetComment() const @@ -154,7 +153,6 @@ ScUndoMakeOutline::ScUndoMakeOutline( ScDocShell* pNewDocShell, ScUndoMakeOutline::~ScUndoMakeOutline() { - delete pUndoTable; } OUString ScUndoMakeOutline::GetComment() const @@ -174,7 +172,7 @@ void ScUndoMakeOutline::Undo() ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart, aBlockEnd ); - rDoc.SetOutlineTable( nTab, pUndoTable ); + rDoc.SetOutlineTable( nTab, pUndoTable.get() ); SCTAB nVisTab = pViewShell->GetViewData().GetTabNo(); if ( nVisTab != nTab ) diff --git a/sc/source/ui/undo/undodraw.cxx b/sc/source/ui/undo/undodraw.cxx index 110f9f3e4e94..484dd76f42ce 100644 --- a/sc/source/ui/undo/undodraw.cxx +++ b/sc/source/ui/undo/undodraw.cxx @@ -35,12 +35,6 @@ ScUndoDraw::ScUndoDraw( SfxUndoAction* pUndo, ScDocShell* pDocSh ) : ScUndoDraw::~ScUndoDraw() { - delete pDrawUndo; -} - -void ScUndoDraw::ForgetDrawUndo() -{ - pDrawUndo = nullptr; // do not delete (DrawUndo has to be remembered from outside) } OUString ScUndoDraw::GetComment() const diff --git a/sc/source/ui/undo/undorangename.cxx b/sc/source/ui/undo/undorangename.cxx index 16624c901a6e..ec2564f357cf 100644 --- a/sc/source/ui/undo/undorangename.cxx +++ b/sc/source/ui/undo/undorangename.cxx @@ -87,7 +87,6 @@ ScUndoAddRangeData::ScUndoAddRangeData(ScDocShell* pDocSh, ScRangeData* pRangeDa ScUndoAddRangeData::~ScUndoAddRangeData() { - delete mpRangeData; } void ScUndoAddRangeData::Undo() |