From 19e715973e15f9e7cf6e8237643dbbc14f8eb87a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 29 Oct 2018 16:15:27 +0200 Subject: loplugin:useuniqueptr in MarkedUndoAction Change-Id: Ic06b990112df5bc135cfd7af6f1129580f294428 Reviewed-on: https://gerrit.libreoffice.org/62509 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/view/outlview.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sd') 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 pTemp = pListAction->RemoveX(0); + pPrevListAction->Insert( std::move(pTemp), nDestAction++ ); } pPrevListAction->nCurUndoAction = pPrevListAction->maUndoActions.size(); } -- cgit