From f7ce839c7844f029c0a1ac83a5638e83356b4c4b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Oct 2018 11:22:10 +0200 Subject: use unique_ptr in SfxUndoManager::AddUndoAction Change-Id: I11483e3cece12a7373f4276972b4c899edf1ce15 Reviewed-on: https://gerrit.libreoffice.org/61566 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svl/source/undo/undo.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'svl/source/undo') 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 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() ); } } -- cgit