diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-08 15:19:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-09 10:07:46 +0200 |
commit | 96a2aa94b2a68e12ab74cb6d8f4a16f6c63e4ccf (patch) | |
tree | 3401b0846e9b97cbf2d123d535f32e18b2d9f5f9 /svl | |
parent | 44bccf92bc78daa93e969e8b37aeef96a3b38987 (diff) |
loplugin:constantparam in svl
Change-Id: Iefc441262cbdc6f115ea4ca5a673456b59477e13
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/filerec/filerec.cxx | 4 | ||||
-rw-r--r-- | svl/source/undo/undo.cxx | 25 |
2 files changed, 12 insertions, 17 deletions
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index 01b13171f69f..9379b6afa1be 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -313,7 +313,7 @@ sal_uInt32 SfxMultiFixRecordWriter::Close() if ( !_bHeaderOk ) { // remember position after header, to be able to seek back to it - sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( false ); + sal_uInt32 nEndPos = SfxSingleRecordWriter::Close(); // write extended header after SfxSingleRecord _pStream->WriteUInt16( _nContentCount ); @@ -432,7 +432,7 @@ sal_uInt32 SfxMultiVarRecordWriter::Close() _pStream->WriteUInt32( _aContentOfs[n] ); // skip SfxMultiFixRecordWriter::Close()! - sal_uInt32 nEndPos = SfxSingleRecordWriter::Close( false ); + sal_uInt32 nEndPos = SfxSingleRecordWriter::Close(); // write own header _pStream->WriteUInt16( _nContentCount ); 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 |