summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-29 16:15:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 09:28:07 +0100
commit19e715973e15f9e7cf6e8237643dbbc14f8eb87a (patch)
tree41d67c523f803a79791cea58e0b9ddc89de6a0eb /sd
parentda02b574b4b077ba819350eec76a37eaf0ceeeb0 (diff)
loplugin:useuniqueptr in MarkedUndoAction
Change-Id: Ic06b990112df5bc135cfd7af6f1129580f294428 Reviewed-on: https://gerrit.libreoffice.org/62509 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/outlview.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 837b40927758..f2264eff09f5 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1522,10 +1522,9 @@ void OutlineView::TryToMergeUndoActions()
// the top EditUndo of the previous undo list
// first remove the merged undo action
- DBG_ASSERT( pListAction->GetUndoAction(nEditPos) == pEditUndo,
+ assert( pListAction->GetUndoAction(nEditPos) == pEditUndo &&
"sd::OutlineView::TryToMergeUndoActions(), wrong edit pos!" );
- pListAction->Remove(nEditPos);
- delete pEditUndo;
+ pListAction->RemoveX(nEditPos);
if ( !pListAction->maUndoActions.empty() )
{
@@ -1536,10 +1535,8 @@ void OutlineView::TryToMergeUndoActions()
size_t nDestAction = pPrevListAction->maUndoActions.size();
while( nCount-- )
{
- SfxUndoAction* pTemp = pListAction->GetUndoAction(0);
- pListAction->Remove(0);
- if( pTemp )
- pPrevListAction->Insert( pTemp, nDestAction++ );
+ std::unique_ptr<SfxUndoAction> pTemp = pListAction->RemoveX(0);
+ pPrevListAction->Insert( std::move(pTemp), nDestAction++ );
}
pPrevListAction->nCurUndoAction = pPrevListAction->maUndoActions.size();
}