summaryrefslogtreecommitdiff
path: root/svl
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
parent44bccf92bc78daa93e969e8b37aeef96a3b38987 (diff)
loplugin:constantparam in svl
Change-Id: Iefc441262cbdc6f115ea4ca5a673456b59477e13
Diffstat (limited to 'svl')
-rw-r--r--svl/source/filerec/filerec.cxx4
-rw-r--r--svl/source/undo/undo.cxx25
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