diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-01 09:12:39 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-01 11:20:24 +0200 |
commit | c6eb232cb7b2a1fc58edb379463d1aa589973af4 (patch) | |
tree | dfb9fb601727b83356ece5f8a37394677d1590ee /svl | |
parent | 3da977def7fa97e791c279c05de6b2e06b79fcd4 (diff) |
loplugin:unuseddefaultparam in svl
Change-Id: Ifc82563c8930332d460df4d97935ba6e9946689f
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/filerec/filerec.cxx | 10 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 50 | ||||
-rw-r--r-- | svl/source/misc/inethist.cxx | 8 | ||||
-rw-r--r-- | svl/source/misc/inettype.cxx | 7 | ||||
-rw-r--r-- | svl/source/misc/urihelper.cxx | 9 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 8 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 65 | ||||
-rw-r--r-- | svl/source/undo/undo.cxx | 4 |
9 files changed, 48 insertions, 117 deletions
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx index 73bd612161d2..01b13171f69f 100644 --- a/svl/source/filerec/filerec.cxx +++ b/svl/source/filerec/filerec.cxx @@ -307,7 +307,7 @@ SfxMultiFixRecordWriter::SfxMultiFixRecordWriter(sal_uInt8 nRecordType, /** * @see SfxMiniRecordWriter */ -sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) +sal_uInt32 SfxMultiFixRecordWriter::Close() { // Header not written yet? if ( !_bHeaderOk ) @@ -320,8 +320,7 @@ sal_uInt32 SfxMultiFixRecordWriter::Close( bool bSeekToEndOfRec ) _pStream->WriteUInt32( _nContentSize ); // seek to end of record or stay after the header - if ( bSeekToEndOfRec ) - _pStream->Seek(nEndPos); + _pStream->Seek(nEndPos); return nEndPos; } @@ -417,7 +416,7 @@ void SfxMultiVarRecordWriter::NewContent() /** * @see SfxMiniRecordWriter */ -sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) +sal_uInt32 SfxMultiVarRecordWriter::Close() { // Header not written yet? if ( !_bHeaderOk ) @@ -444,8 +443,7 @@ sal_uInt32 SfxMultiVarRecordWriter::Close( bool bSeekToEndOfRec ) _pStream->WriteUInt32( nContentOfsPos ); // seek to the end of the record or stay where we are - if ( bSeekToEndOfRec ) - _pStream->Seek(nEndPos); + _pStream->Seek(nEndPos); return nEndPos; } diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index ca03fb863f31..40fd54cb9bd6 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -1000,14 +1000,14 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, bool bDeep ) const } -sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, bool bDeep ) const +sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich ) const { if ( !IsWhich(nWhich) ) return 0; if ( !IsInRange( nWhich ) ) { - if ( pImp->mpSecondary && bDeep ) + if ( pImp->mpSecondary ) return pImp->mpSecondary->GetTrueSlotId(nWhich); assert(false && "unknown WhichId - cannot get slot-id"); return 0; diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 1f7728827ce6..d55bfa6818c7 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -325,29 +325,20 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) return nDel; } -void SfxItemSet::ClearInvalidItems( bool bHardDefault ) +void SfxItemSet::ClearInvalidItems() { sal_uInt16* pPtr = m_pWhichRanges; SfxItemArray ppFnd = m_pItems; - if ( bHardDefault ) - while( *pPtr ) - { - for ( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd ) - if ( IsInvalidItem(*ppFnd) ) - *ppFnd = &m_pPool->Put( m_pPool->GetDefaultItem(nWhich) ); - pPtr += 2; - } - else - while( *pPtr ) - { - for( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd ) - if( IsInvalidItem(*ppFnd) ) - { - *ppFnd = nullptr; - --m_nCount; - } - pPtr += 2; - } + while( *pPtr ) + { + for( sal_uInt16 nWhich = *pPtr; nWhich <= *(pPtr+1); ++nWhich, ++ppFnd ) + if( IsInvalidItem(*ppFnd) ) + { + *ppFnd = nullptr; + --m_nCount; + } + pPtr += 2; + } } void SfxItemSet::InvalidateAllItems() @@ -1139,7 +1130,7 @@ static void MergeItem_Impl( SfxItemPool *_pPool, sal_uInt16 &rCount, } } -void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults ) +void SfxItemSet::MergeValues( const SfxItemSet& rSet ) { // WARNING! When making changes/fixing bugs, always update the table above!! assert( GetPool() == rSet.GetPool() && "MergeValues with different Pools" ); @@ -1167,7 +1158,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults ) SfxItemArray ppFnd2 = rSet.m_pItems; for( ; nSize; --nSize, ++ppFnd1, ++ppFnd2 ) - MergeItem_Impl(m_pPool, m_nCount, ppFnd1, *ppFnd2, bIgnoreDefaults); + MergeItem_Impl(m_pPool, m_nCount, ppFnd1, *ppFnd2, false/*bIgnoreDefaults*/); } else { @@ -1180,14 +1171,13 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, bool bIgnoreDefaults ) if( !pItem ) { // Not set, so default - if ( !bIgnoreDefaults ) - MergeValue( rSet.GetPool()->GetDefaultItem( nWhich ), bIgnoreDefaults ); + MergeValue( rSet.GetPool()->GetDefaultItem( nWhich ) ); } else if( IsInvalidItem( pItem ) ) // don't care InvalidateItem( nWhich ); else - MergeValue( *pItem, bIgnoreDefaults ); + MergeValue( *pItem ); } } } @@ -1326,22 +1316,18 @@ void SfxItemSet::Load ( SvStream& rStream, // Stream we're loading from - bool bDirect, /* true + bool bDirect /* true Items are directly read form the stream and not via Surrogates false (default) Items are read via Surrogates */ - - const SfxItemPool* pRefPool /* Pool that can resolve the Surrogates - (e.g. when inserting documents) */ ) { assert(m_pPool); - // No RefPool => Resolve Surrogates with ItemSet's Pool - if ( !pRefPool ) - pRefPool = m_pPool; + // Resolve Surrogates with ItemSet's Pool + const SfxItemPool *pRefPool = m_pPool; // Load Item count and as many Items sal_uInt16 nCount = 0; diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index ce76e2bd6b99..09fec7d6a65c 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -71,9 +71,9 @@ class INetURLHistory_Impl: private boost::noncopyable /** Initialization. */ - void initialize (sal_uInt16 nLru, sal_uInt32 nHash = 0) + void initialize (sal_uInt16 nLru) { - m_nHash = nHash; + m_nHash = 0; m_nLru = nLru; m_nMBZ = 0; } @@ -100,9 +100,9 @@ class INetURLHistory_Impl: private boost::noncopyable /** Initialization. */ - void initialize (sal_uInt16 nThis, sal_uInt32 nHash = 0) + void initialize (sal_uInt16 nThis) { - m_nHash = nHash; + m_nHash = 0; m_nNext = nThis; m_nPrev = nThis; } diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx index 15ca63f9f89c..fc99529d5902 100644 --- a/svl/source/misc/inettype.cxx +++ b/svl/source/misc/inettype.cxx @@ -537,14 +537,13 @@ MediaTypeEntry const * seekEntry(OUString const & rTypeName, //static INetContentType INetContentTypes::RegisterContentType(OUString const & rTypeName, OUString const & rPresentation, - OUString const * pExtension, - OUString const * pSystemFileType) + OUString const * pExtension) { INetContentType eTypeID = GetContentType(rTypeName); if (eTypeID == CONTENT_TYPE_UNKNOWN) eTypeID = Registration::RegisterContentType(rTypeName, rPresentation, pExtension, - pSystemFileType); + nullptr/*pSystemFileType*/); else if (eTypeID > CONTENT_TYPE_LAST) { TypeIDMapEntry * pTypeEntry = Registration::getEntry(eTypeID); @@ -552,8 +551,6 @@ INetContentType INetContentTypes::RegisterContentType(OUString const & rTypeName { if (!rPresentation.isEmpty()) pTypeEntry->m_aPresentation = rPresentation; - if (pSystemFileType) - pTypeEntry->m_aSystemFileType = *pSystemFileType; } if (pExtension) { diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index e24b982bf240..b53a725dde55 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -429,8 +429,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, sal_Int32 & rEnd, CharClass const & rCharClass, INetURLObject::EncodeMechanism eMechanism, - rtl_TextEncoding eCharset, - INetURLObject::FSysStyle eStyle) + rtl_TextEncoding eCharset) { if (!(rBegin <= rEnd && rEnd <= rText.getLength())) return OUString(); @@ -529,7 +528,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, { INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos), INetProtocol::File, eMechanism, eCharset, - eStyle); + INetURLObject::FSYS_DETECT); if (!aUri.HasError()) { rBegin = nPos; @@ -618,7 +617,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, } } - if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 3 + if (rEnd - nPos >= 3 && rText[nPos + 1] == ':' && (rText[nPos + 2] == '/' || rText[nPos + 2] == '\\')) // 7th, 8th @@ -644,7 +643,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText, } } } - else if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 2 + else if (rEnd - nPos >= 2 && rText[nPos] == '\\' && rText[nPos + 1] == '\\') // 6th { diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 7b1f0bd60f35..dd48e2cad78e 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -944,7 +944,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( return GetEntryTable(eTypetmp, FIndex, rLnge); } -sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bNoAdditionalFormats ) +sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge ) { ChangeIntl(eLnge); sal_uInt32 CLOffset = ImpGetCLOffset(ActLnge); @@ -999,7 +999,7 @@ sal_uInt32 SvNumberFormatter::ImpGenerateCL( LanguageType eLnge, bool bNoAdditio } MaxCLOffset += SV_COUNTRY_LANGUAGE_OFFSET; - ImpGenerateFormats( MaxCLOffset, bNoAdditionalFormats ); + ImpGenerateFormats( MaxCLOffset, false/*bNoAdditionalFormats*/ ); CLOffset = MaxCLOffset; } return CLOffset; @@ -2092,13 +2092,13 @@ sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex( void SvNumberFormatter::ImpAdjustFormatCodeDefault( css::i18n::NumberFormatCode * pFormatArr, - sal_Int32 nCnt, bool bCheckCorrectness ) + sal_Int32 nCnt ) { using namespace ::com::sun::star; if ( !nCnt ) return; - if (bCheckCorrectness && LocaleDataWrapper::areChecksEnabled()) + if (LocaleDataWrapper::areChecksEnabled()) { // check the locale data for correctness OStringBuffer aMsg; diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 1590893423c5..c19d52bdafb3 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -1594,32 +1594,20 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString, void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter, LanguageType eConvertFrom, - LanguageType eConvertTo, bool bSystem ) + LanguageType eConvertTo ) { sal_Int32 nCheckPos; sal_uInt32 nKey; short nType = eType; OUString aFormatString( sFormatstring ); - if ( bSystem ) - { - rConverter.PutandConvertEntrySystem( aFormatString, nCheckPos, nType, - nKey, eConvertFrom, eConvertTo ); - } - else - { - rConverter.PutandConvertEntry( aFormatString, nCheckPos, nType, - nKey, eConvertFrom, eConvertTo ); - } + rConverter.PutandConvertEntry( aFormatString, nCheckPos, nType, + nKey, eConvertFrom, eConvertTo ); const SvNumberformat* pFormat = rConverter.GetEntry( nKey ); DBG_ASSERT( pFormat, "SvNumberformat::ConvertLanguage: Conversion ohne Format" ); if ( pFormat ) { ImpCopyNumberformat( *pFormat ); // Reset values taken over from Formatter/Scanner - if ( bSystem ) - { - maLocale.meLanguage = LANGUAGE_SYSTEM; - } // pColor still points to table in temporary Formatter/Scanner for ( sal_uInt16 i = 0; i < 4; i++ ) { @@ -4488,8 +4476,7 @@ const OUString* SvNumberformat::GetNumForString( sal_uInt16 nNumFor, sal_uInt16 return &NumFor[nNumFor].Info().sStrArray[nPos]; } -short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, - bool bString /* = false */ ) const +short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos ) const { if ( nNumFor > 3 ) { @@ -4503,41 +4490,11 @@ short SvNumberformat::GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, if ( nPos == 0xFFFF ) { nPos = nAnz - 1; - if ( bString ) - { - // Backwards - short* pType = NumFor[nNumFor].Info().nTypeArray + nPos; - while ( nPos > 0 && (*pType != NF_SYMBOLTYPE_STRING) && - (*pType != NF_SYMBOLTYPE_CURRENCY) ) - { - pType--; - nPos--; - } - if ( (*pType != NF_SYMBOLTYPE_STRING) && (*pType != NF_SYMBOLTYPE_CURRENCY) ) - { - return 0; - } - } } else if ( nPos > nAnz - 1 ) { return 0; } - else if ( bString ) - { - // Forwards - short* pType = NumFor[nNumFor].Info().nTypeArray + nPos; - while ( nPos < nAnz && (*pType != NF_SYMBOLTYPE_STRING) && - (*pType != NF_SYMBOLTYPE_CURRENCY) ) - { - pType++; - nPos++; - } - if ( (*pType != NF_SYMBOLTYPE_STRING) && (*pType != NF_SYMBOLTYPE_CURRENCY) ) - { - return 0; - } - } return NumFor[nNumFor].Info().nTypeArray[nPos]; } @@ -4706,8 +4663,7 @@ static void lcl_SvNumberformat_AddLimitStringImpl( OUString& rStr, } OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, - const LocaleDataWrapper& rLocWrp, - bool bDontQuote ) const + const LocaleDataWrapper& rLocWrp ) const { OUStringBuffer aStr; bool bDefault[4]; @@ -4854,11 +4810,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, aStr.append( rLocWrp.getTime100SecSep() ); break; case NF_SYMBOLTYPE_STRING : - if( bDontQuote ) - { - aStr.append( pStr[j] ); - } - else if ( pStr[j].getLength() == 1 ) + if ( pStr[j].getLength() == 1 ) { aStr.append( '\\' ); aStr.append( pStr[j] ); @@ -5076,8 +5028,7 @@ bool SvNumberformat::IsInQuote( const OUString& rStr, sal_Int32 nPos, // static sal_Int32 SvNumberformat::GetQuoteEnd( const OUString& rStr, sal_Int32 nPos, - sal_Unicode cQuote, sal_Unicode cEscIn, - sal_Unicode cEscOut ) + sal_Unicode cQuote, sal_Unicode cEscIn ) { if ( nPos < 0 ) { @@ -5088,7 +5039,7 @@ sal_Int32 SvNumberformat::GetQuoteEnd( const OUString& rStr, sal_Int32 nPos, { return -1; } - if ( !IsInQuote( rStr, nPos, cQuote, cEscIn, cEscOut ) ) + if ( !IsInQuote( rStr, nPos, cQuote, cEscIn ) ) { if ( rStr[ nPos ] == cQuote ) { diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index 868f275f15fc..164c6534ca4e 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -849,11 +849,11 @@ size_t SfxUndoManager::ImplGetRedoActionCount_Lock( bool const i_currentLevel ) } -SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo, bool const i_currentLevel ) const +SfxUndoAction* SfxUndoManager::GetRedoAction( size_t nNo ) const { UndoManagerGuard aGuard( *m_xData ); - const SfxUndoArray* pUndoArray = i_currentLevel ? m_xData->pActUndoArray : m_xData->pUndoArray; + const SfxUndoArray* pUndoArray = m_xData->pActUndoArray; if ( (pUndoArray->nCurUndoAction + nNo) > pUndoArray->aUndoActions.size() ) { return nullptr; |