loplugin:unuseddefaultparam in svl

Change-Id: Ifc82563c8930332d460df4d97935ba6e9946689f
This commit is contained in:
Noel Grandin 2016-03-01 09:12:39 +02:00
parent 3da977def7
commit c6eb232cb7
17 changed files with 64 additions and 139 deletions

View File

@ -386,7 +386,7 @@ protected:
public:
inline ~SfxMultiFixRecordWriter();
sal_uInt32 Close( bool bSeekToEndOfRec = true );
sal_uInt32 Close();
};
/** write record with multiple content items
@ -450,7 +450,7 @@ public:
void NewContent();
sal_uInt32 Close( bool bSeekToEndOfRec = true );
sal_uInt32 Close();
};
/** write record with multiple content items with identical size

View File

@ -219,8 +219,7 @@ class SVL_DLLPUBLIC INetContentTypes
public:
static INetContentType RegisterContentType(OUString const & rTypeName,
OUString const & rPresentation,
OUString const * pExtension = nullptr,
OUString const * pSystemFileType = nullptr);
OUString const * pExtension = nullptr);
static INetContentType GetContentType(OUString const & rTypeName);

View File

@ -204,7 +204,7 @@ public:
sal_uInt16 GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetSlotId( sal_uInt16 nWhich, bool bDeep = true ) const;
sal_uInt16 GetTrueWhich( sal_uInt16 nSlot, bool bDeep = true ) const;
sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich, bool bDeep = true ) const;
sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich ) const;
void SetVersionMap( sal_uInt16 nVer,
sal_uInt16 nOldStart, sal_uInt16 nOldEnd,

View File

@ -118,7 +118,7 @@ public:
void DisableItem(sal_uInt16 nWhich);
void InvalidateItem( sal_uInt16 nWhich );
sal_uInt16 ClearItem( sal_uInt16 nWhich = 0);
void ClearInvalidItems( bool bHardDefault = false );
void ClearInvalidItems();
void InvalidateAllItems(); // HACK(via nWhich = 0) ???
inline void SetParent( const SfxItemSet* pNew );
@ -136,7 +136,7 @@ public:
bool Set( const SfxItemSet&, bool bDeep = true );
void Intersect( const SfxItemSet& rSet );
void MergeValues( const SfxItemSet& rSet, bool bOverwriteDefaults = false );
void MergeValues( const SfxItemSet& rSet );
void Differentiate( const SfxItemSet& rSet );
void MergeValue( const SfxPoolItem& rItem, bool bOverwriteDefaults = false );
@ -146,8 +146,7 @@ public:
void MergeRange( sal_uInt16 nFrom, sal_uInt16 nTo );
const SfxItemSet* GetParent() const { return m_pParent; }
void Load( SvStream &, bool bDirect = false,
const SfxItemPool *pRefPool = nullptr );
void Load( SvStream &, bool bDirect = false );
void Store( SvStream &, bool bDirect = false ) const;
bool operator==(const SfxItemSet &) const;

View File

@ -199,7 +199,7 @@ namespace svl
virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const = 0;
virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
virtual SfxUndoAction* GetRedoAction( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const = 0;
virtual SfxUndoAction* GetRedoAction( size_t nNo=0 ) const = 0;
virtual bool Undo() = 0;
virtual bool Redo() = 0;
@ -317,7 +317,7 @@ public:
virtual SfxUndoAction* GetUndoAction( size_t nNo=0 ) const override;
virtual size_t GetRedoActionCount( bool const i_currentLevel = CurrentLevel ) const override;
virtual OUString GetRedoActionComment( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const override;
virtual SfxUndoAction* GetRedoAction( size_t nNo=0, bool const i_currentLevel = CurrentLevel ) const override;
virtual SfxUndoAction* GetRedoAction( size_t nNo=0 ) const override;
virtual bool Undo() override;
virtual bool Redo() override;
virtual void Clear() override;

View File

@ -120,8 +120,7 @@ SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const & rText,
sal_Int32 & rEnd,
CharClass const & rCharClass,
INetURLObject::EncodeMechanism eMechanism = INetURLObject::WAS_ENCODED,
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT);
rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
/** Remove any password component from both absolute and relative URLs.

View File

@ -845,7 +845,7 @@ private:
LanguageType eLnge );
// Create builtin formats for language/country if necessary, return CLOffset
SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge, bool bNoAdditionalFormats = false );
SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL( LanguageType eLnge );
// Build negative currency format, old compatibility style
SVL_DLLPRIVATE void ImpGetNegCurrFormat(OUStringBuffer& sNegStr, const OUString& rCurrSymbol);
@ -879,7 +879,7 @@ private:
// Non-PRODUCT version may check locale data for matching defaults in one
// FormatElement group.
SVL_DLLPRIVATE void ImpAdjustFormatCodeDefault( css::i18n::NumberFormatCode * pFormatArr,
sal_Int32 nCount, bool bCheckCorrectness = true );
sal_Int32 nCount );
// Obtain the format entry for a given key index.
SVL_DLLPRIVATE SvNumberformat* GetFormatEntry( sal_uInt32 nKey );

View File

@ -196,8 +196,7 @@ public:
// Build a format string of application defined keywords
OUString GetMappedFormatstring( const NfKeywordTable& rKeywords,
const LocaleDataWrapper& rLoc,
bool bDontQuote = false ) const;
const LocaleDataWrapper& rLoc ) const;
void SetStarFormatSupport( bool b ) { bStarFlag = b; }
@ -239,7 +238,7 @@ public:
//! Only onLoad: convert from stored to current system language/country
void ConvertLanguage( SvNumberFormatter& rConverter,
LanguageType eConvertFrom, LanguageType eConvertTo, bool bSystem = false );
LanguageType eConvertFrom, LanguageType eConvertTo );
// Substring of a subformat code nNumFor (0..3)
// nPos == 0xFFFF => last substring
@ -249,8 +248,7 @@ public:
// Subtype of a subformat code nNumFor (0..3)
// nPos == 0xFFFF => last substring
// bString==true: first/last SYMBOLTYPE_STRING or SYMBOLTYPE_CURRENCY
short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos, bool bString = false ) const;
short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos ) const;
sal_Int32 GetForcedDenominatorForType( sal_uInt16 nNumFor ) const;
/** If the count of string elements (substrings, ignoring [modifiers] and
@ -354,8 +352,7 @@ public:
*/
static sal_Int32 GetQuoteEnd( const OUString& rString, sal_Int32 nPos,
sal_Unicode cQuote = '"',
sal_Unicode cEscIn = '\0',
sal_Unicode cEscOut = '\\' );
sal_Unicode cEscIn = '\0' );
void SetComment( const OUString& rStr )
{ sComment = rStr; }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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