summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-08 11:22:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-09 12:09:55 +0200
commitf7ce839c7844f029c0a1ac83a5638e83356b4c4b (patch)
treec93a342a577133b384a3ccc088d7d0675d4fb9e3 /svl
parent4ba06560e33f17ca1ed72ad722c80eae5ffd4277 (diff)
use unique_ptr in SfxUndoManager::AddUndoAction
Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15 Reviewed-on: https://gerrit.libreoffice.org/61566 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/undo/undo.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 3b2085108126..ec0f280145c4 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -595,15 +595,16 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT
}
-void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, bool bTryMerge )
+void SfxUndoManager::AddUndoAction( std::unique_ptr<SfxUndoAction> pAction, bool bTryMerge )
{
UndoManagerGuard aGuard( *m_xData );
// add
- if ( ImplAddUndoAction_NoNotify( pAction, bTryMerge, true, aGuard ) )
+ auto pActionTmp = pAction.get();
+ if ( ImplAddUndoAction_NoNotify( pAction.release(), bTryMerge, true, aGuard ) )
{
// notify listeners
- aGuard.scheduleNotification( &SfxUndoListener::undoActionAdded, pAction->GetComment() );
+ aGuard.scheduleNotification( &SfxUndoListener::undoActionAdded, pActionTmp->GetComment() );
}
}