loplugin:constantparam in svl

Change-Id: Iefc441262cbdc6f115ea4ca5a673456b59477e13
This commit is contained in:
Noel Grandin
2016-03-08 15:19:44 +02:00
parent 44bccf92bc
commit 96a2aa94b2
5 changed files with 19 additions and 25 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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 );

View File

@@ -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 ) )
{
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;
}
aGuard.markForDeletion( pActionToRemove );
m_xData->pUndoArray->aUndoActions.Remove( 0 );
--m_xData->pUndoArray->nCurUndoAction;
--nActionsToRemove;
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

View File

@@ -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();
}
}