loplugin:simplifybool

Change-Id: I6e181bc4b144c2559ede99d3bae0496cf546415c
This commit is contained in:
Stephan Bergmann
2015-04-24 12:24:50 +02:00
parent d39b9c29d5
commit ed83ba34a5
4 changed files with 5 additions and 5 deletions

View File

@@ -546,7 +546,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj); SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() ); SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
pDest->setHasFixedSize( pSource ? pSource->hasFixedSize() : false ); pDest->setHasFixedSize( pSource && pSource->hasFixedSize() );
if ( pSource && pSource->GetDims() && pSource->hasFixedSize() ) if ( pSource && pSource->GetDims() && pSource->hasFixedSize() )
{ {
sal_Int32 lb = 0; sal_Int32 lb = 0;

View File

@@ -550,7 +550,7 @@ bool SbiTokenizer::MayBeLabel( bool bNeedsColon )
{ {
if( eCurTok == SYMBOL || m_aTokenLabelInfo.canTokenBeLabel( eCurTok ) ) if( eCurTok == SYMBOL || m_aTokenLabelInfo.canTokenBeLabel( eCurTok ) )
{ {
return bNeedsColon ? DoesColonFollow() : true; return !bNeedsColon || DoesColonFollow();
} }
else else
{ {

View File

@@ -2517,7 +2517,7 @@ RTLFUNC(IsArray)
} }
else else
{ {
rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? true : false ); rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) != 0);
} }
} }

View File

@@ -1084,7 +1084,7 @@ static bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
{ {
pStrm->Seek( nFPos + nBlockLen ); pStrm->Seek( nFPos + nBlockLen );
} }
return pStrm->GetErrorCode() ? false : true; return pStrm->GetErrorCode() == 0;
} }
static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
@@ -1195,7 +1195,7 @@ static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
{ {
pStrm->Seek( nFPos + nBlockLen ); pStrm->Seek( nFPos + nBlockLen );
} }
return pStrm->GetErrorCode() ? false : true; return pStrm->GetErrorCode() == 0;
} }