diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-28 19:57:21 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-28 20:24:40 +0100 |
commit | 9d29f9913faaefe350d7e056330368b3dfa26d49 (patch) | |
tree | 5daa4993ba62911ee9c833e4dcc09556ec5fb612 /svl/source/items | |
parent | c35616dd73c8b05e422f3b561f21e21f5489d574 (diff) |
bool improvements
Change-Id: I6cf511b92383f3cd60923620518b9233b82850c0
Diffstat (limited to 'svl/source/items')
-rw-r--r-- | svl/source/items/cntwall.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/ilstitem.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 24 | ||||
-rw-r--r-- | svl/source/items/itemset.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/lckbitem.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/poolio.cxx | 46 | ||||
-rw-r--r-- | svl/source/items/rngitem.cxx | 10 | ||||
-rw-r--r-- | svl/source/items/srchitem.cxx | 16 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 14 |
9 files changed, 61 insertions, 61 deletions
diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 585e6bb08eea..1b5f04e4fef1 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -48,7 +48,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, sal_True ); + _nColor.Read( rStream, true ); rStream >> _nStyle; } else @@ -120,7 +120,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, sal_True ); + (const_cast< CntWallpaperItem* >(this))->_nColor.Write( rStream, true ); rStream.WriteUInt16( _nStyle ); return rStream; diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index 53d4bb730449..ab7c3f82f1ce 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -59,7 +59,7 @@ SfxIntegerListItem::~SfxIntegerListItem() bool SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const { if ( !rPoolItem.ISA( SfxIntegerListItem ) ) - return sal_False; + return false; const SfxIntegerListItem rItem = (const SfxIntegerListItem&) rPoolItem; return rItem.m_aList == m_aList; diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 83e2e12655ab..b5000d6783c1 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -101,7 +101,7 @@ const SfxPoolItem* SfxItemPool::GetPoolDefaultItem( sal_uInt16 nWhich ) const pRet = pImp->mpSecondary->GetPoolDefaultItem( nWhich ); else { - SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get pool default" ); + SFX_ASSERT( false, nWhich, "unknown Which-Id - cannot get pool default" ); pRet = 0; } return pRet; @@ -125,7 +125,7 @@ bool SfxItemPool::IsItemFlag( sal_uInt16 nWhich, sal_uInt16 nFlag ) const return pPool->IsItemFlag_Impl( pPool->GetIndex_Impl(nWhich), nFlag); } DBG_ASSERT( !IsWhich(nWhich), "unknown which-id" ); - return sal_False; + return false; } // ----------------------------------------------------------------------- @@ -233,7 +233,7 @@ SfxItemPool::SfxItemPool DBG_CTOR(SfxItemPool, 0); pImp->eDefMetric = rPool.pImp->eDefMetric; pImp->nVersion = rPool.pImp->nVersion; - pImp->bStreaming = sal_False; + pImp->bStreaming = false; pImp->nLoadingVersion = 0; pImp->nInitRefCount = 1; pImp->nVerStart = rPool.pImp->nVerStart; @@ -653,7 +653,7 @@ void SfxItemPool::SetPoolDefaultItem(const SfxPoolItem &rItem) pImp->mpSecondary->SetPoolDefaultItem(rItem); else { - SFX_ASSERT( 0, rItem.Which(), "unknown Which-Id - cannot set pool default" ); + SFX_ASSERT( false, rItem.Which(), "unknown Which-Id - cannot set pool default" ); } } @@ -678,7 +678,7 @@ void SfxItemPool::ResetPoolDefaultItem( sal_uInt16 nWhichId ) pImp->mpSecondary->ResetPoolDefaultItem(nWhichId); else { - SFX_ASSERT( 0, nWhichId, "unknown Which-Id - cannot set pool default" ); + SFX_ASSERT( false, nWhichId, "unknown Which-Id - cannot set pool default" ); } } @@ -872,7 +872,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) ReleaseRef( *p ); else { - SFX_ASSERT( 0, rItem.Which(), "removing Item without ref" ); + SFX_ASSERT( false, rItem.Which(), "removing Item without ref" ); } // ggf. kleinstmoegliche freie Position merken @@ -889,7 +889,7 @@ void SfxItemPool::Remove( const SfxPoolItem& rItem ) } // nicht vorhanden - SFX_ASSERT( 0, rItem.Which(), "removing Item not in Pool" ); + SFX_ASSERT( false, rItem.Which(), "removing Item not in Pool" ); } // ----------------------------------------------------------------------- @@ -902,7 +902,7 @@ const SfxPoolItem& SfxItemPool::GetDefaultItem( sal_uInt16 nWhich ) const { if ( pImp->mpSecondary ) return pImp->mpSecondary->GetDefaultItem( nWhich ); - SFX_ASSERT( 0, nWhich, "unknown which - dont ask me for defaults" ); + SFX_ASSERT( false, nWhich, "unknown which - dont ask me for defaults" ); } DBG_ASSERT( pImp->ppStaticDefaults, "no defaults known - dont ask me for defaults" ); @@ -975,7 +975,7 @@ const SfxPoolItem *SfxItemPool::GetItem2(sal_uInt16 nWhich, sal_uInt32 nOfst) co { if ( pImp->mpSecondary ) return pImp->mpSecondary->GetItem2( nWhich, nOfst ); - SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); + SFX_ASSERT( false, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } @@ -1000,7 +1000,7 @@ sal_uInt32 SfxItemPool::GetItemCount2(sal_uInt16 nWhich) const { if ( pImp->mpSecondary ) return pImp->mpSecondary->GetItemCount2( nWhich ); - SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot resolve surrogate" ); + SFX_ASSERT( false, nWhich, "unknown Which-Id - cannot resolve surrogate" ); return 0; } @@ -1037,7 +1037,7 @@ sal_uInt16 SfxItemPool::GetSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const { if ( pImp->mpSecondary && bDeep ) return pImp->mpSecondary->GetSlotId(nWhich); - SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" ); + SFX_ASSERT( false, nWhich, "unknown Which-Id - cannot get slot-id" ); return 0; } @@ -1072,7 +1072,7 @@ sal_uInt16 SfxItemPool::GetTrueSlotId( sal_uInt16 nWhich, sal_Bool bDeep ) const { if ( pImp->mpSecondary && bDeep ) return pImp->mpSecondary->GetTrueSlotId(nWhich); - SFX_ASSERT( 0, nWhich, "unknown Which-Id - cannot get slot-id" ); + SFX_ASSERT( false, nWhich, "unknown Which-Id - cannot get slot-id" ); return 0; } return pItemInfos[nWhich - pImp->mnStart]._nSID; diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index b305121cc50e..e4155cc35d1d 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1478,7 +1478,7 @@ sal_uInt16 SfxItemSet::GetWhichByPos( sal_uInt16 nPos ) const nPos = nPos - n; pPtr += 2; } - DBG_ASSERT( sal_False, "Hier sind wir falsch" ); + DBG_ASSERT( false, "Hier sind wir falsch" ); return 0; } diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx index b2655095936c..eeb25ec8bfe9 100644 --- a/svl/source/items/lckbitem.cxx +++ b/svl/source/items/lckbitem.cxx @@ -38,7 +38,7 @@ SfxLockBytesItem::SfxLockBytesItem( sal_uInt16 nW, SvStream &rStream ) : SfxPoolItem( nW ) { rStream.Seek( 0L ); - _xVal = new SvLockBytes( new SvMemoryStream(), sal_True ); + _xVal = new SvLockBytes( new SvMemoryStream(), true ); SvStream aLockBytesStream( _xVal ); rStream >> aLockBytesStream; @@ -123,7 +123,7 @@ bool SfxLockBytesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 pStream->Write( (void*)aSeq.getConstArray(), aSeq.getLength() ); pStream->Seek(0); - _xVal = new SvLockBytes( pStream, sal_True ); + _xVal = new SvLockBytes( pStream, true ); } else _xVal = NULL; diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index b96c2d6d5245..9c19a4fdde42 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -114,7 +114,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const pStoreMaster = pStoreMaster->pImp->mpSecondary; // Alter-Header (Version des Pools an sich und Inhalts-Version 0xffff) - pImp->bStreaming = sal_True; + pImp->bStreaming = true; if ( !pStoreMaster ) { rStream.WriteUInt16( rStream.GetVersion() >= SOFFICE_FILEFORMAT_50 @@ -273,7 +273,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const if ( !rStream.GetError() && pImp->mpSecondary ) pImp->mpSecondary->Store( rStream ); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -507,7 +507,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) pLoadMaster = pLoadMaster->pImp->mpSecondary; // Gesamt Header einlesen - pImp->bStreaming = sal_True; + pImp->bStreaming = true; if ( !pLoadMaster ) { // Format-Version laden @@ -528,7 +528,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( pImp->nMajorVer > SFX_ITEMPOOL_VER_MAJOR ) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -541,7 +541,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) SfxMiniRecordReader aPoolRec( &rStream, SFX_ITEMPOOL_REC ); if ( rStream.GetError() ) { - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -553,7 +553,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER ); if ( rStream.GetError() ) { - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -567,7 +567,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); aPoolRec.Skip(); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } } @@ -577,7 +577,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) SfxMultiRecordReader aVerRec( &rStream, SFX_ITEMPOOL_REC_VERSIONMAP ); if ( rStream.GetError() ) { - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -704,7 +704,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) if ( aExternName != pImp->aName ) pImp->aName = OUString(); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; }; @@ -736,13 +736,13 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) rStream >> pImp->nLoadingVersion; aExternName = SfxPoolItem::readByteString(rStream); bOwnPool = aExternName == pImp->aName; - pImp->bStreaming = sal_True; + pImp->bStreaming = true; //! solange wir keine fremden laden k"onnen if ( !bOwnPool ) { rStream.SetError(SVSTREAM_FILEFORMAT_ERROR); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -751,7 +751,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) pImp->nVersion < pImp->nLoadingVersion ) { rStream.SetError(ERRCODE_IO_WRONGVERSION); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -1010,7 +1010,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) if ( aExternName != pImp->aName ) pImp->aName = OUString(); - pImp->bStreaming = sal_False; + pImp->bStreaming = false; return rStream; } @@ -1090,7 +1090,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate { // gemappte SlotId kann "ubernommen werden rWhich = nMappedWhich; - bResolvable = sal_True; + bResolvable = true; } } @@ -1134,7 +1134,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate } } - SFX_ASSERT( sal_False, rWhich, "can't resolve Which-Id in LoadSurrogate" ); + SFX_ASSERT( false, rWhich, "can't resolve Which-Id in LoadSurrogate" ); } return 0; @@ -1178,7 +1178,7 @@ bool SfxItemPool::StoreSurrogate } rStream.WriteUInt32( SFX_ITEMS_NULL ); - return sal_True; + return true; } // ----------------------------------------------------------------------- @@ -1194,7 +1194,7 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const { if ( pImp->mpSecondary ) return pImp->mpSecondary->GetSurrogate( pItem ); - SFX_ASSERT( 0, pItem->Which(), "unknown Which-Id - dont ask me for surrogates" ); + SFX_ASSERT( false, pItem->Which(), "unknown Which-Id - dont ask me for surrogates" ); } // Pointer auf static- oder pool-dflt-Attribut? @@ -1210,7 +1210,7 @@ sal_uInt32 SfxItemPool::GetSurrogate(const SfxPoolItem *pItem) const if ( p == pItem ) return i; } - SFX_ASSERT( 0, pItem->Which(), "Item not in the pool"); + SFX_ASSERT( false, pItem->Which(), "Item not in the pool"); return SFX_ITEMS_NULL; } @@ -1374,7 +1374,7 @@ sal_uInt16 SfxItemPool::GetNewWhich { if ( pImp->mpSecondary ) return pImp->mpSecondary->GetNewWhich( nFileWhich ); - SFX_ASSERT( 0, nFileWhich, "unknown which in GetNewWhich()" ); + SFX_ASSERT( false, nFileWhich, "unknown which in GetNewWhich()" ); } // Version neuer/gleich/"alter? @@ -1496,11 +1496,11 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, DBG_ASSERT( !IsInvalidItem(&rItem), "cannot store invalid items" ); if ( IsSlot( rItem.Which() ) ) - return sal_False; + return false; const SfxItemPool *pPool = this; while ( !pPool->IsInStoringRange(rItem.Which()) ) if ( 0 == ( pPool = pPool->pImp->mpSecondary ) ) - return sal_False; + return false; DBG_ASSERT( !pImp->bInSetItem || !rItem.ISA(SfxSetItem), "SetItem contains ItemSet with SetItem" ); @@ -1508,7 +1508,7 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, sal_uInt16 nSlotId = pPool->GetSlotId( rItem.Which(), sal_True ); sal_uInt16 nItemVersion = rItem.GetVersion(pImp->mnFileFormatVersion); if ( USHRT_MAX == nItemVersion ) - return sal_False; + return false; rStream.WriteUInt16( rItem.Which() ).WriteUInt16( nSlotId ); if ( bDirect || !pPool->StoreSurrogate( rStream, &rItem ) ) @@ -1523,7 +1523,7 @@ bool SfxItemPool::StoreItem( SvStream &rStream, const SfxPoolItem &rItem, rStream.Seek( nIEnd ); } - return sal_True; + return true; } diff --git a/svl/source/items/rngitem.cxx b/svl/source/items/rngitem.cxx index db2bc0c86cd1..9e3154413045 100644 --- a/svl/source/items/rngitem.cxx +++ b/svl/source/items/rngitem.cxx @@ -82,8 +82,8 @@ bool SfxRangeItem::operator==( const SfxPoolItem& rItem ) const DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" ); SfxRangeItem* pT = (SfxRangeItem*)&rItem; if( nFrom==pT->nFrom && nTo==pT->nTo ) - return 1; - return 0; + return true; + return false; } // ----------------------------------------------------------------------- @@ -150,14 +150,14 @@ bool SfxUShortRangesItem::operator==( const SfxPoolItem &rItem ) const { const SfxUShortRangesItem &rOther = (const SfxUShortRangesItem&) rItem; if ( !_pRanges && !rOther._pRanges ) - return sal_True; + return true; if ( _pRanges || rOther._pRanges ) - return sal_False; + return false; sal_uInt16 n; for ( n = 0; _pRanges[n] && rOther._pRanges[n]; ++n ) if ( *_pRanges != rOther._pRanges[n] ) - return 0; + return false; return !_pRanges[n] && !rOther._pRanges[n]; } diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index 8ab36d37ceb1..5e4ee561b2ab 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -113,14 +113,14 @@ SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) : nCommand ( 0 ), nCellType ( SVX_SEARCHIN_FORMULA ), nAppFlag ( SVX_SEARCHAPP_WRITER ), - bRowDirection ( sal_True ), - bAllTables ( sal_False ), - bSearchFiltered ( sal_False ), - bNotes ( sal_False), - bBackward ( sal_False ), - bPattern ( sal_False ), - bContent ( sal_False ), - bAsianOptions ( sal_False ) + bRowDirection ( true ), + bAllTables ( false ), + bSearchFiltered ( false ), + bNotes ( false), + bBackward ( false ), + bPattern ( false ), + bContent ( false ), + bAsianOptions ( false ) { EnableNotification( lcl_GetNotifyNames() ); diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 55bca3f0a65d..f8e15d2324f1 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -96,8 +96,8 @@ SfxStyleSheetBase::SfxStyleSheetBase( const OUString& rName, SfxStyleSheetBasePo , pSet( NULL ) , nMask(mask) , nHelpId( 0 ) - , bMySet( sal_False ) - , bHidden( sal_False ) + , bMySet( false ) + , bHidden( false ) { #ifdef DBG_UTIL aDbgStyleSheetReferences.mnStyles++; @@ -161,7 +161,7 @@ bool SfxStyleSheetBase::SetName( const OUString& rName ) OUString aOldName = aName; SfxStyleSheetBase *pOther = pPool->Find( rName, nFamily ) ; if ( pOther && pOther != this ) - return sal_False; + return false; SfxStyleFamily eTmpFam = pPool->GetSearchFamily(); sal_uInt16 nTmpMask = pPool->GetSearchMask(); @@ -169,7 +169,7 @@ bool SfxStyleSheetBase::SetName( const OUString& rName ) pPool->SetSearchMask(nFamily); if ( !aName.isEmpty() ) - pPool->ChangeParent( aName, rName, sal_False ); + pPool->ChangeParent( aName, rName, false ); if ( aFollow == aName ) aFollow = rName; @@ -269,7 +269,7 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet() if( !pSet ) { pSet = new SfxItemSet( pPool->GetPool() ); - bMySet = sal_True; + bMySet = true; } return *pSet; } @@ -385,11 +385,11 @@ SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase, { pBasePool=pBase; nSearchFamily=eFam; - bSearchUsed=sal_False; + bSearchUsed=false; if( (( n & SFXSTYLEBIT_ALL_VISIBLE ) != SFXSTYLEBIT_ALL_VISIBLE ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED)) { - bSearchUsed = sal_True; + bSearchUsed = true; n &= ~SFXSTYLEBIT_USED; } nMask=n; |