summaryrefslogtreecommitdiff
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
parent44bccf92bc78daa93e969e8b37aeef96a3b38987 (diff)
loplugin:constantparam in svl
Change-Id: Iefc441262cbdc6f115ea4ca5a673456b59477e13
-rw-r--r--include/svl/filerec.hxx11
-rw-r--r--include/svl/undo.hxx2
-rw-r--r--svl/source/filerec/filerec.cxx4
-rw-r--r--svl/source/undo/undo.cxx25
-rw-r--r--sw/source/core/undo/docundo.cxx2
5 files changed, 19 insertions, 25 deletions
diff --git a/include/svl/filerec.hxx b/include/svl/filerec.hxx
index 063d2961908f..107dd61ceb1f 100644
--- a/include/svl/filerec.hxx
+++ b/include/svl/filerec.hxx
@@ -295,7 +295,7 @@ protected:
sal_uInt16 nTag, sal_uInt8 nCurVer );
public:
- sal_uInt32 Close( bool bSeekToEndOfRec = true );
+ sal_uInt32 Close();
};
/**
@@ -588,7 +588,7 @@ inline void SfxMiniRecordReader::Skip()
}
/// @see SfxMiniRecordWriter::Close()
-inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
+inline sal_uInt32 SfxSingleRecordWriter::Close()
{
sal_uInt32 nRet = 0;
@@ -596,17 +596,16 @@ inline sal_uInt32 SfxSingleRecordWriter::Close( bool bSeekToEndOfRec )
if ( !_bHeaderOk )
{
// write base class header
- sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( bSeekToEndOfRec );
+ sal_uInt32 nEndPos = SfxMiniRecordWriter::Close( false/*bSeekToEndOfRec*/ );
// seek the end of the own header if needed or stay behind the record
- if ( !bSeekToEndOfRec )
- _pStream->SeekRel( SFX_REC_HEADERSIZE_SINGLE );
+ _pStream->SeekRel( SFX_REC_HEADERSIZE_SINGLE );
nRet = nEndPos;
}
#ifdef DBG_UTIL
else
// check base class header
- SfxMiniRecordWriter::Close( bSeekToEndOfRec );
+ SfxMiniRecordWriter::Close( false/*bSeekToEndOfRec*/ );
#endif
return nRet;
diff --git a/include/svl/undo.hxx b/include/svl/undo.hxx
index 4893dde77a1a..72cb5023865a 100644
--- a/include/svl/undo.hxx
+++ b/include/svl/undo.hxx
@@ -354,7 +354,7 @@ public:
/** removes the oldest Undo actions from the stack
*/
- void RemoveOldestUndoActions( size_t const i_count );
+ void RemoveOldestUndoAction();
void dumpAsXml(struct _xmlTextWriter* pWriter) const;
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
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 02969f6dda90..056179d5da9f 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -424,7 +424,7 @@ void UndoManager::AddUndoAction(SfxUndoAction *pAction, bool bTryMerge)
// if the undo nodes array is too large, delete some actions
while (UNDO_ACTION_LIMIT < GetUndoNodes().Count())
{
- RemoveOldestUndoActions(1);
+ RemoveOldestUndoAction();
}
}