From d58e542d7df3f761047b0e5f9a5917901b4579d1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 11 Aug 2015 08:42:22 +0200 Subject: loplugin: defaultparams Change-Id: I1d88744207f7fa7c8230f8b29d9cc123f488dfaa --- sot/source/sdstor/stgstrms.cxx | 8 ++++---- sot/source/sdstor/ucbstorage.cxx | 6 +++--- svl/source/items/cntwall.cxx | 4 ++-- svl/source/items/itemset.cxx | 12 ++++++------ svl/source/items/poolio.cxx | 12 ++++++------ svl/source/items/style.cxx | 6 +++--- svl/source/numbers/zforfind.cxx | 4 ++-- svl/source/numbers/zforlist.cxx | 8 ++++---- svl/source/undo/undo.cxx | 2 +- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index a530501da2bb..ecd987fffa2b 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -271,7 +271,7 @@ bool StgFAT::InitNew( sal_Int32 nPage1 ) // use the Pos2Page() method of the stream rStrm.Pos2Page( nPage1 << 2 ); // Initialize the page - pPg = rStrm.GetIo().Copy( rStrm.GetPage(), STG_FREE ); + pPg = rStrm.GetIo().Copy( rStrm.GetPage() ); if ( !pPg.is() ) return false; for( short i = 0; i < nEntries; i++ ) @@ -589,7 +589,7 @@ sal_Int32 StgFATStrm::GetPage( short nOff, bool bMake, sal_uInt16 *pnMasterAlloc // create a new master page nFAT = nMaxPage++; - pMaster = rIo.Copy( nFAT, STG_FREE ); + pMaster = rIo.Copy( nFAT ); if ( pMaster.is() ) { for( short k = 0; k < (short)( nPageSize >> 2 ); k++ ) @@ -741,7 +741,7 @@ bool StgFATStrm::SetSize( sal_Int32 nBytes ) return false; } // Set up the page with empty entries - rtl::Reference< StgPage > pPg = rIo.Copy( nNewPage, STG_FREE ); + rtl::Reference< StgPage > pPg = rIo.Copy( nNewPage ); if ( !pPg.is() ) return false; for( short j = 0; j < (short)( nPageSize >> 2 ); j++ ) @@ -847,7 +847,7 @@ bool StgDataStrm::SetSize( sal_Int32 nBytes ) { Pos2Page( nBytes ); if( nPage >= 0 ) - rIo.Copy( nPage, STG_FREE ); + rIo.Copy( nPage ); } } return true; diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index fa557af651ea..bf1f72f6cec3 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1535,7 +1535,7 @@ UCBStorage_Impl::UCBStorage_Impl( const ::ucbhelper::Content& rContent, const OU // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( true ); + m_pTempFile->EnableKillingFile(); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } @@ -1568,7 +1568,7 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt // no name given = use temporary name! DBG_ASSERT( m_bIsRoot, "SubStorage must have a name!" ); m_pTempFile = new ::utl::TempFile; - m_pTempFile->EnableKillingFile( true ); + m_pTempFile->EnableKillingFile(); m_aName = m_aOriginalName = aName = m_pTempFile->GetURL(); } @@ -1614,7 +1614,7 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool { // opening in direct mode is too fuzzy because the data is transferred to the stream in the Commit() call, // which will be called in the storages' dtor - m_pTempFile->EnableKillingFile( true ); + m_pTempFile->EnableKillingFile(); DBG_ASSERT( !bDirect, "Storage on a stream must not be opened in direct mode!" ); // UCBStorages work on a content, so a temporary file for a content must be created, even if the stream is only diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 827c88c35fae..fcd7419b7f2b 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -50,7 +50,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn _aURL = readUnicodeString(rStream, nVersion >= 1); // !!! Color stream operators do not work - they discard any // transparency info !!! - _nColor.Read( rStream, true ); + _nColor.Read( rStream ); rStream.ReadUInt16( _nStyle ); } else @@ -122,7 +122,7 @@ SvStream& CntWallpaperItem::Store( SvStream& rStream, sal_uInt16 ) const // !!! Color stream operators do not work - they discard any // transparency info !!! // ??? Why the hell Color::Write(...) isn't const ??? - (const_cast< CntWallpaperItem* >(this))->_nColor.Write( rStream, true ); + (const_cast< CntWallpaperItem* >(this))->_nColor.Write( rStream ); rStream.WriteUInt16( _nStyle ); return rStream; diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index 8a8dafd89666..e6961c4649f9 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -296,7 +296,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) if ( nWhich <= SFX_WHICH_MAX ) { const SfxPoolItem& rNew = m_pParent - ? m_pParent->Get( nWhich, true ) + ? m_pParent->Get( nWhich ) : m_pPool->GetDefaultItem( nWhich ); Changed( *pItemToClear, rNew ); @@ -334,7 +334,7 @@ sal_uInt16 SfxItemSet::ClearItem( sal_uInt16 nWhich ) if ( nWhich <= SFX_WHICH_MAX ) { const SfxPoolItem& rNew = m_pParent - ? m_pParent->Get( nWhich, true ) + ? m_pParent->Get( nWhich ) : m_pPool->GetDefaultItem( nWhich ); Changed( *pItemToClear, rNew ); @@ -524,7 +524,7 @@ const SfxPoolItem* SfxItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich if (nWhich <= SFX_WHICH_MAX ) { const SfxPoolItem& rOld = m_pParent - ? m_pParent->Get( nWhich, true ) + ? m_pParent->Get( nWhich ) : m_pPool->GetDefaultItem( nWhich ); Changed( rOld, rNew ); } @@ -974,7 +974,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet ) if(nWhich <= SFX_WHICH_MAX) { const SfxPoolItem& rNew = m_pParent - ? m_pParent->Get( nWhich, true ) + ? m_pParent->Get( nWhich ) : m_pPool->GetDefaultItem( nWhich ); Changed( **ppFnd1, rNew ); @@ -1042,7 +1042,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet ) if(nWhich <= SFX_WHICH_MAX) { const SfxPoolItem& rNew = m_pParent - ? m_pParent->Get( nWhich, true ) + ? m_pParent->Get( nWhich ) : m_pPool->GetDefaultItem( nWhich ); Changed( **ppFnd1, rNew ); @@ -1824,7 +1824,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi { bIncrementCount = true; pOld = (m_pParent) - ? &m_pParent->Get( nWhich, true ) + ? &m_pParent->Get( nWhich ) : ((nWhich <= SFX_WHICH_MAX) ? &m_pPool->GetDefaultItem(nWhich) : nullptr); diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 1d2e30f1657c..441396054eab 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -324,7 +324,7 @@ void SfxItemPool::LoadCompleted() { if (*ppHtArr) { - if ( !ReleaseRef( **ppHtArr, 1 ) ) + if ( !ReleaseRef( **ppHtArr ) ) DELETEZ( *ppHtArr ); } } @@ -389,7 +389,7 @@ void SfxItemPool_Impl::readTheItems ( if ( !mbPersistentRefCounts ) // Hold onto it until SfxItemPool::LoadCompleted() - SfxItemPool::AddRef(*pItem, 1); + SfxItemPool::AddRef(*pItem); else { if ( nRef > SFX_ITEMS_OLD_MAXREF ) @@ -482,7 +482,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) { DBG_WARNING( "loading non-empty ItemPool" ); - AddRef( **ppHtArr, 1 ); + AddRef( **ppHtArr ); } } } @@ -798,7 +798,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate { // If the pool in the stream has a different structure, the SlotId // from the stream must be mapable to a WhichId - sal_uInt16 nMappedWhich = nSlotId ? GetWhich(nSlotId, true) : 0; + sal_uInt16 nMappedWhich = nSlotId ? GetWhich(nSlotId) : 0; if ( IsWhich(nMappedWhich) ) { // Mapped SlotId can be taken over @@ -839,7 +839,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // References have NOT been loaded together with the pool? if ( !pTarget->HasPersistentRefCounts() ) - AddRef( *pItem, 1 ); + AddRef( *pItem ); else return pItem; @@ -1165,7 +1165,7 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem), "SetItem contains ItemSet with SetItem" ); - sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), true ); + sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which() ); sal_uInt16 nItemVersion = rItem.GetVersion(pImp->mnFileFormatVersion); if ( USHRT_MAX == nItemVersion ) return false; diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 4404a2543d03..5e9e5246004c 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -837,7 +837,7 @@ void SfxStyleSheetBasePool::ChangeParent(const OUString& rOld, bool bVirtual) { const sal_uInt16 nTmpMask = GetSearchMask(); - SetSearchMask(GetSearchFamily(), SFXSTYLEBIT_ALL); + SetSearchMask(GetSearchFamily()); for( SfxStyleSheetBase* p = First(); p; p = Next() ) { if( p->GetParent() == rOld ) @@ -891,14 +891,14 @@ bool SfxStyleSheet::SetParent( const OUString& rName ) // Remove from notification chain of the old parent if applicable if(!aOldParent.isEmpty()) { - SfxStyleSheet *pParent = static_cast(pPool->Find(aOldParent, nFamily, SFXSTYLEBIT_ALL)); + SfxStyleSheet *pParent = static_cast(pPool->Find(aOldParent, nFamily)); if(pParent) EndListening(*pParent); } // Add to the notification chain of the new parent if(!aParent.isEmpty()) { - SfxStyleSheet *pParent = static_cast(pPool->Find(aParent, nFamily, SFXSTYLEBIT_ALL)); + SfxStyleSheet *pParent = static_cast(pPool->Find(aParent, nFamily)); if(pParent) StartListening(*pParent); } diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index a8d849faa5f4..f359c509cd46 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1244,7 +1244,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) using namespace comphelper::string; // Trailing blanks in input. OUStringBuffer aBuf(sStrArray[nNext]); - aBuf.stripEnd((sal_Unicode)' '); + aBuf.stripEnd(); // Expand again in case of pattern "M. D. " and // input "M. D. ", maybe fetched far, but.. padToLength(aBuf, rPat.getLength() - nPat, ' '); @@ -1356,7 +1356,7 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I // IsAcceptedDatePattern(). using namespace comphelper::string; OUStringBuffer aBuf(sStrArray[nNext]); - aBuf.stripEnd((sal_Unicode)' '); + aBuf.stripEnd(); padToLength(aBuf, rPat.getLength() - nPat, ' '); bOk = (rPat.indexOf( aBuf.makeStringAndClear(), nPat) == nPat); } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 38bdce0a7518..69ec74d7269e 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3767,8 +3767,8 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr if ( bBank ) { // Only bank symbols. - OUString aPositiveBank = rCurr.BuildPositiveFormatString(true, *xLocaleData, 1); - OUString aNegativeBank = rCurr.BuildNegativeFormatString(true, *xLocaleData, 1 ); + OUString aPositiveBank = rCurr.BuildPositiveFormatString(true, *xLocaleData); + OUString aNegativeBank = rCurr.BuildNegativeFormatString(true, *xLocaleData ); OUStringBuffer format1(aPositiveBank); format1.append(';'); @@ -3789,8 +3789,8 @@ sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr { // Mixed formats like in SvNumberFormatter::ImpGenerateFormats() but no // duplicates if no decimals in currency. - OUString aPositive = rCurr.BuildPositiveFormatString(false, *xLocaleData, 1); - OUString aNegative = rCurr.BuildNegativeFormatString(false, *xLocaleData, 1 ); + OUString aPositive = rCurr.BuildPositiveFormatString(false, *xLocaleData ); + OUString aNegative = rCurr.BuildNegativeFormatString(false, *xLocaleData ); OUStringBuffer format1; OUStringBuffer format2; OUStringBuffer format3; diff --git a/svl/source/undo/undo.cxx b/svl/source/undo/undo.cxx index f7cd0ac30aac..045586dca21e 100644 --- a/svl/source/undo/undo.cxx +++ b/svl/source/undo/undo.cxx @@ -655,7 +655,7 @@ bool SfxUndoManager::ImplAddUndoAction_NoNotify( SfxUndoAction *pAction, bool bT } // clear redo stack, if requested - if ( bClearRedo && ( ImplGetRedoActionCount_Lock( CurrentLevel ) > 0 ) ) + if ( bClearRedo && ( ImplGetRedoActionCount_Lock() > 0 ) ) ImplClearRedo( i_guard, IUndoManager::CurrentLevel ); // respect max number -- cgit