sal_Bool to bool

Change-Id: I7dcb2dcef78c67d90ff2dea58c1374bd17ac58af
This commit is contained in:
Takeshi Abe 2013-04-25 15:00:54 +09:00
parent 52b618e196
commit 9d97a2af7c
14 changed files with 49 additions and 49 deletions

View File

@ -35,7 +35,7 @@ namespace svt {
class SVL_DLLPUBLIC DocumentLockFile : public LockFileCommon class SVL_DLLPUBLIC DocumentLockFile : public LockFileCommon
{ {
// the workaround for automated testing! // the workaround for automated testing!
static sal_Bool m_bAllowInteraction; static bool m_bAllowInteraction;
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenStream(); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > OpenStream();
@ -45,15 +45,15 @@ public:
DocumentLockFile( const OUString& aOrigURL ); DocumentLockFile( const OUString& aOrigURL );
~DocumentLockFile(); ~DocumentLockFile();
sal_Bool CreateOwnLockFile(); bool CreateOwnLockFile();
::com::sun::star::uno::Sequence< OUString > GetLockData(); ::com::sun::star::uno::Sequence< OUString > GetLockData();
sal_Bool OverwriteOwnLockFile(); bool OverwriteOwnLockFile();
void RemoveFile(); void RemoveFile();
// the methods allow to control whether UI interaction regarding the locked document file is allowed // the methods allow to control whether UI interaction regarding the locked document file is allowed
// this is a workaround for automated tests // this is a workaround for automated tests
static void AllowInteraction( sal_Bool bAllow ) { m_bAllowInteraction = bAllow; } static void AllowInteraction( bool bAllow ) { m_bAllowInteraction = bAllow; }
static sal_Bool IsInteractionAllowed() { return m_bAllowInteraction; } static bool IsInteractionAllowed() { return m_bAllowInteraction; }
}; };
} }

View File

@ -42,8 +42,8 @@ public:
~SfxUShortRanges() ~SfxUShortRanges()
{ delete [] _pRanges; } { delete [] _pRanges; }
sal_Bool operator == ( const SfxUShortRanges & ) const; bool operator == ( const SfxUShortRanges & ) const;
sal_Bool operator != ( const SfxUShortRanges & rRanges ) const bool operator != ( const SfxUShortRanges & rRanges ) const
{ return !( *this == rRanges ); } { return !( *this == rRanges ); }
SfxUShortRanges& operator = ( const SfxUShortRanges & ); SfxUShortRanges& operator = ( const SfxUShortRanges & );
@ -53,7 +53,7 @@ public:
SfxUShortRanges& operator /= ( const SfxUShortRanges & ); SfxUShortRanges& operator /= ( const SfxUShortRanges & );
sal_uInt16 Count() const; sal_uInt16 Count() const;
sal_Bool IsEmpty() const bool IsEmpty() const
{ return !_pRanges || 0 == *_pRanges; } { return !_pRanges || 0 == *_pRanges; }
operator const sal_uInt16* () const operator const sal_uInt16* () const

View File

@ -48,10 +48,10 @@ ItemHolder2::ItemHolder2()
#ifdef DBG_UTIL #ifdef DBG_UTIL
catch(const css::uno::Exception& rEx) catch(const css::uno::Exception& rEx)
{ {
static sal_Bool bMessage = sal_True; static bool bMessage = true;
if(bMessage) if(bMessage)
{ {
bMessage = sal_False; bMessage = false;
OString sMsg("CreateInstance with arguments exception: "); OString sMsg("CreateInstance with arguments exception: ");
sMsg += OString(rEx.Message.getStr(), sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(), rEx.Message.getLength(),

View File

@ -394,7 +394,7 @@ void SfxItemPool::SetSecondaryPool( SfxItemPool *pPool )
if ( !pImp->maPoolItems.empty() && !pImp->mpSecondary->pImp->maPoolItems.empty() ) if ( !pImp->maPoolItems.empty() && !pImp->mpSecondary->pImp->maPoolItems.empty() )
{ {
// hat der master SetItems? // hat der master SetItems?
sal_Bool bHasSetItems = sal_False; bool bHasSetItems = false;
for ( sal_uInt16 i = 0; !bHasSetItems && i < pImp->mnEnd - pImp->mnStart; ++i ) for ( sal_uInt16 i = 0; !bHasSetItems && i < pImp->mnEnd - pImp->mnStart; ++i )
bHasSetItems = pImp->ppStaticDefaults[i]->ISA(SfxSetItem); bHasSetItems = pImp->ppStaticDefaults[i]->ISA(SfxSetItem);

View File

@ -1059,7 +1059,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
} }
// teste mal, ob sich die Which-Bereiche unterscheiden. // teste mal, ob sich die Which-Bereiche unterscheiden.
sal_Bool bEqual = sal_True; bool bEqual = true;
sal_uInt16* pWh1 = _pWhichRanges; sal_uInt16* pWh1 = _pWhichRanges;
sal_uInt16* pWh2 = rSet._pWhichRanges; sal_uInt16* pWh2 = rSet._pWhichRanges;
sal_uInt16 nSize = 0; sal_uInt16 nSize = 0;
@ -1068,7 +1068,7 @@ void SfxItemSet::Intersect( const SfxItemSet& rSet )
{ {
if( *pWh1 != *pWh2 ) if( *pWh1 != *pWh2 )
{ {
bEqual = sal_False; bEqual = false;
break; break;
} }
if( n & 1 ) if( n & 1 )
@ -1130,7 +1130,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
return; return;
// teste mal, ob sich die Which-Bereiche unterscheiden. // teste mal, ob sich die Which-Bereiche unterscheiden.
sal_Bool bEqual = sal_True; bool bEqual = true;
sal_uInt16* pWh1 = _pWhichRanges; sal_uInt16* pWh1 = _pWhichRanges;
sal_uInt16* pWh2 = rSet._pWhichRanges; sal_uInt16* pWh2 = rSet._pWhichRanges;
sal_uInt16 nSize = 0; sal_uInt16 nSize = 0;
@ -1139,7 +1139,7 @@ void SfxItemSet::Differentiate( const SfxItemSet& rSet )
{ {
if( *pWh1 != *pWh2 ) if( *pWh1 != *pWh2 )
{ {
bEqual = sal_False; bEqual = false;
break; break;
} }
if( n & 1 ) if( n & 1 )
@ -1347,7 +1347,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
DBG_ASSERT( GetPool() == rSet.GetPool(), "MergeValues mit verschiedenen Pools" ); DBG_ASSERT( GetPool() == rSet.GetPool(), "MergeValues mit verschiedenen Pools" );
// teste mal, ob sich die Which-Bereiche unterscheiden. // teste mal, ob sich die Which-Bereiche unterscheiden.
sal_Bool bEqual = sal_True; bool bEqual = true;
sal_uInt16* pWh1 = _pWhichRanges; sal_uInt16* pWh1 = _pWhichRanges;
sal_uInt16* pWh2 = rSet._pWhichRanges; sal_uInt16* pWh2 = rSet._pWhichRanges;
sal_uInt16 nSize = 0; sal_uInt16 nSize = 0;
@ -1356,7 +1356,7 @@ void SfxItemSet::MergeValues( const SfxItemSet& rSet, sal_Bool bIgnoreDefaults )
{ {
if( *pWh1 != *pWh2 ) if( *pWh1 != *pWh2 )
{ {
bEqual = sal_False; bEqual = false;
break; break;
} }
if( n & 1 ) if( n & 1 )
@ -1964,13 +1964,13 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi
const SfxPoolItem& rNew = _pPool->Put( rItem, nWhich ); const SfxPoolItem& rNew = _pPool->Put( rItem, nWhich );
// altes Item merken // altes Item merken
sal_Bool bIncrementCount = sal_False; bool bIncrementCount = false;
const SfxPoolItem* pOld = *( _aItems + nPos ); const SfxPoolItem* pOld = *( _aItems + nPos );
if ( reinterpret_cast< SfxPoolItem* >( -1 ) == pOld ) // state "dontcare" if ( reinterpret_cast< SfxPoolItem* >( -1 ) == pOld ) // state "dontcare"
pOld = NULL; pOld = NULL;
if ( !pOld ) if ( !pOld )
{ {
bIncrementCount = sal_True; bIncrementCount = true;
pOld = _pParent ? pOld = _pParent ?
&_pParent->Get( nWhich, sal_True ) &_pParent->Get( nWhich, sal_True )
: nWhich <= SFX_WHICH_MAX ? &_pPool->GetDefaultItem( nWhich ) : 0; : nWhich <= SFX_WHICH_MAX ? &_pPool->GetDefaultItem( nWhich ) : 0;

View File

@ -201,20 +201,20 @@ SfxUShortRanges::SfxUShortRanges( const sal_uInt16* pArr )
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool SfxUShortRanges::operator==( const SfxUShortRanges &rOther ) const bool SfxUShortRanges::operator==( const SfxUShortRanges &rOther ) const
{ {
// Object pointers equal? // Object pointers equal?
if ( this == &rOther ) if ( this == &rOther )
return sal_True; return true;
// Ranges pointers equal? // Ranges pointers equal?
if ( _pRanges == rOther._pRanges ) if ( _pRanges == rOther._pRanges )
return sal_True; return true;
// Counts equal? // Counts equal?
sal_uInt16 nCount = Count(); sal_uInt16 nCount = Count();
if ( nCount != rOther.Count() ) if ( nCount != rOther.Count() )
return sal_False; return false;
// Check arrays. // Check arrays.
sal_uInt16 n = 0; sal_uInt16 n = 0;
@ -222,12 +222,12 @@ sal_Bool SfxUShortRanges::operator==( const SfxUShortRanges &rOther ) const
{ {
// Elements at current position equal? // Elements at current position equal?
if ( _pRanges[ n ] != rOther._pRanges[ n ] ) if ( _pRanges[ n ] != rOther._pRanges[ n ] )
return sal_False; return false;
++n; ++n;
} }
return sal_True; return true;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------

View File

@ -1544,7 +1544,7 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream, bool bDirect,
sal_uInt16 nWhich(0), nSlot(0); // nSurrogate; sal_uInt16 nWhich(0), nSlot(0); // nSurrogate;
rStream >> nWhich >> nSlot; rStream >> nWhich >> nSlot;
sal_Bool bDontPut = (SfxItemPool*)-1 == pRefPool; bool bDontPut = (SfxItemPool*)-1 == pRefPool;
if ( bDontPut || !pRefPool ) if ( bDontPut || !pRefPool )
pRefPool = this; pRefPool = this;

View File

@ -120,7 +120,7 @@ SvStream& SfxPointItem::Store(SvStream &rStream, sal_uInt16 ) const
bool SfxPointItem::QueryValue( uno::Any& rVal, bool SfxPointItem::QueryValue( uno::Any& rVal,
sal_uInt8 nMemberId ) const sal_uInt8 nMemberId ) const
{ {
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
awt::Point aTmp(aVal.X(), aVal.Y()); awt::Point aTmp(aVal.X(), aVal.Y());
if( bConvert ) if( bConvert )
{ {
@ -144,7 +144,7 @@ bool SfxPointItem::QueryValue( uno::Any& rVal,
bool SfxPointItem::PutValue( const uno::Any& rVal, bool SfxPointItem::PutValue( const uno::Any& rVal,
sal_uInt8 nMemberId ) sal_uInt8 nMemberId )
{ {
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
bool bRet = false; bool bRet = false;
awt::Point aValue; awt::Point aValue;

View File

@ -220,7 +220,7 @@ SfxPoolItem* SvxSearchItem::Clone( SfxItemPool *) const
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
//! used below //! used below
static sal_Bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 ) static bool operator == ( const SearchOptions& rItem1, const SearchOptions& rItem2 )
{ {
return rItem1.algorithmType == rItem2.algorithmType && return rItem1.algorithmType == rItem2.algorithmType &&
rItem1.searchFlag == rItem2.searchFlag && rItem1.searchFlag == rItem2.searchFlag &&

View File

@ -115,7 +115,7 @@ SvStream& SfxSizeItem::Store(SvStream &rStream, sal_uInt16 ) const
bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal, bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal,
sal_uInt8 nMemberId ) const sal_uInt8 nMemberId ) const
{ {
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
Size aTmp(aVal); Size aTmp(aVal);
@ -146,7 +146,7 @@ bool SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal,
bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal, bool SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal,
sal_uInt8 nMemberId ) sal_uInt8 nMemberId )
{ {
sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); bool bConvert = 0!=(nMemberId&CONVERT_TWIPS);
nMemberId &= ~CONVERT_TWIPS; nMemberId &= ~CONVERT_TWIPS;
bool bRet = false; bool bRet = false;

View File

@ -50,7 +50,7 @@ using namespace ::com::sun::star;
namespace svt { namespace svt {
sal_Bool DocumentLockFile::m_bAllowInteraction = sal_True; bool DocumentLockFile::m_bAllowInteraction = true;
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
DocumentLockFile::DocumentLockFile( const OUString& aOrigURL ) DocumentLockFile::DocumentLockFile( const OUString& aOrigURL )
@ -85,7 +85,7 @@ void DocumentLockFile::WriteEntryToStream( uno::Sequence< OUString > aEntry, uno
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
sal_Bool DocumentLockFile::CreateOwnLockFile() bool DocumentLockFile::CreateOwnLockFile()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
@ -125,10 +125,10 @@ sal_Bool DocumentLockFile::CreateOwnLockFile()
} }
catch( ucb::NameClashException& ) catch( ucb::NameClashException& )
{ {
return sal_False; return false;
} }
return sal_True; return true;
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -168,7 +168,7 @@ uno::Reference< io::XInputStream > DocumentLockFile::OpenStream()
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
sal_Bool DocumentLockFile::OverwriteOwnLockFile() bool DocumentLockFile::OverwriteOwnLockFile()
{ {
// allows to overwrite the lock file with the current data // allows to overwrite the lock file with the current data
try try
@ -188,10 +188,10 @@ sal_Bool DocumentLockFile::OverwriteOwnLockFile()
} }
catch( uno::Exception& ) catch( uno::Exception& )
{ {
return sal_False; return false;
} }
return sal_True; return true;
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------

View File

@ -94,20 +94,20 @@ class INetURLHistory_Impl
/** Comparison. /** Comparison.
*/ */
sal_Bool operator== (const hash_entry &rOther) const bool operator== (const hash_entry &rOther) const
{ {
return (m_nHash == rOther.m_nHash); return (m_nHash == rOther.m_nHash);
} }
sal_Bool operator< (const hash_entry &rOther) const bool operator< (const hash_entry &rOther) const
{ {
return (m_nHash < rOther.m_nHash); return (m_nHash < rOther.m_nHash);
} }
sal_Bool operator== (sal_uInt32 nHash) const bool operator== (sal_uInt32 nHash) const
{ {
return (m_nHash == nHash); return (m_nHash == nHash);
} }
sal_Bool operator< (sal_uInt32 nHash) const bool operator< (sal_uInt32 nHash) const
{ {
return (m_nHash < nHash); return (m_nHash < nHash);
} }

View File

@ -134,8 +134,8 @@ uno::Sequence< OUString > LockFileCommon::ParseEntry( const uno::Sequence< sal_I
OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& io_nCurPos ) OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sal_Int32& io_nCurPos )
{ {
OStringBuffer aResult; OStringBuffer aResult;
sal_Bool bHaveName = sal_False; bool bHaveName = false;
sal_Bool bEscape = sal_False; bool bEscape = false;
while( !bHaveName ) while( !bHaveName )
{ {
@ -149,15 +149,15 @@ OUString LockFileCommon::ParseName( const uno::Sequence< sal_Int8 >& aBuffer, sa
else else
throw io::WrongFormatException(); throw io::WrongFormatException();
bEscape = sal_False; bEscape = false;
io_nCurPos++; io_nCurPos++;
} }
else if ( aBuffer[io_nCurPos] == ',' || aBuffer[io_nCurPos] == ';' ) else if ( aBuffer[io_nCurPos] == ',' || aBuffer[io_nCurPos] == ';' )
bHaveName = sal_True; bHaveName = true;
else else
{ {
if ( aBuffer[io_nCurPos] == '\\' ) if ( aBuffer[io_nCurPos] == '\\' )
bEscape = sal_True; bEscape = true;
else else
aResult.append( (sal_Char)aBuffer[io_nCurPos] ); aResult.append( (sal_Char)aBuffer[io_nCurPos] );

View File

@ -239,7 +239,7 @@ uno::Sequence< OUString > ShareControlFile::InsertOwnEntry()
uno::Sequence< ::uno::Sequence< OUString > > aNewData( m_aUsersData.getLength() + 1 ); uno::Sequence< ::uno::Sequence< OUString > > aNewData( m_aUsersData.getLength() + 1 );
uno::Sequence< OUString > aNewEntry = GenerateOwnEntry(); uno::Sequence< OUString > aNewEntry = GenerateOwnEntry();
sal_Bool bExists = sal_False; bool bExists = false;
sal_Int32 nNewInd = 0; sal_Int32 nNewInd = 0;
for ( sal_Int32 nInd = 0; nInd < m_aUsersData.getLength(); nInd++ ) for ( sal_Int32 nInd = 0; nInd < m_aUsersData.getLength(); nInd++ )
{ {
@ -252,7 +252,7 @@ uno::Sequence< OUString > ShareControlFile::InsertOwnEntry()
if ( !bExists ) if ( !bExists )
{ {
aNewData[nNewInd] = aNewEntry; aNewData[nNewInd] = aNewEntry;
bExists = sal_True; bExists = true;
} }
} }
else else