summaryrefslogtreecommitdiff
path: root/svl/source/undo
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-08 15:19:44 +0200
committerNoel Grandin <noel@peralex.com>2016-03-09 10:07:46 +0200
commit96a2aa94b2a68e12ab74cb6d8f4a16f6c63e4ccf (patch)
tree3401b0846e9b97cbf2d123d535f32e18b2d9f5f9 /svl/source/undo
parent44bccf92bc78daa93e969e8b37aeef96a3b38987 (diff)
loplugin:constantparam in svl
Change-Id: Iefc441262cbdc6f115ea4ca5a673456b59477e13
Diffstat (limited to 'svl/source/undo')
-rw-r--r--svl/source/undo/undo.cxx25
1 files changed, 10 insertions, 15 deletions
diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx
index 42e96af70527..858c02fde6de 100644
--- a/svl/source/undo/undo.cxx
+++ b/svl/source/undo/undo.cxx
@@ -1254,26 +1254,21 @@ bool SfxUndoManager::HasTopUndoActionMark( UndoStackMark const i_mark )
}
-void SfxUndoManager::RemoveOldestUndoActions( size_t const i_count )
+void SfxUndoManager::RemoveOldestUndoAction()
{
UndoManagerGuard aGuard( *m_xData );
- size_t nActionsToRemove = i_count;
- while ( nActionsToRemove )
- {
- SfxUndoAction* pActionToRemove = m_xData->pUndoArray->aUndoActions[0].pAction;
-
- if ( IsInListAction() && ( m_xData->pUndoArray->nCurUndoAction == 1 ) )
- {
- assert(!"SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!");
- return;
- }
+ SfxUndoAction* pActionToRemove = m_xData->pUndoArray->aUndoActions[0].pAction;
- aGuard.markForDeletion( pActionToRemove );
- m_xData->pUndoArray->aUndoActions.Remove( 0 );
- --m_xData->pUndoArray->nCurUndoAction;
- --nActionsToRemove;
+ if ( IsInListAction() && ( m_xData->pUndoArray->nCurUndoAction == 1 ) )
+ {
+ assert(!"SfxUndoManager::RemoveOldestUndoActions: cannot remove a not-yet-closed list action!");
+ return;
}
+
+ aGuard.markForDeletion( pActionToRemove );
+ m_xData->pUndoArray->aUndoActions.Remove( 0 );
+ --m_xData->pUndoArray->nCurUndoAction;
}
void SfxUndoManager::dumpAsXml(xmlTextWriterPtr pWriter) const