diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-27 14:49:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-28 09:05:11 +0200 |
commit | 5f19287a9cd4167e3be937e3df820446f2e30518 (patch) | |
tree | 64f33b2e66cec0aea2972dc7324534eab3113c6f /basic | |
parent | e871c9cb7ce4f3df2ba6780be62ed46b5ee7a410 (diff) |
loplugin:simplifybool in accessibility..basic
Change-Id: Ibf6cef4baa2d3d400d953ac8bc97a66b5901def9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94972
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 4 | ||||
-rw-r--r-- | basic/source/comp/dim.cxx | 6 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0232c01ca44e..b735933ea9b9 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1482,7 +1482,7 @@ const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, p += 8; nPC += 8; } - else if( !( eOp >= SbiOpcode::SbOP0_START && eOp <= SbiOpcode::SbOP0_END ) ) + else if( eOp < SbiOpcode::SbOP0_START || eOp > SbiOpcode::SbOP0_END ) { StarBASIC::FatalError( ERRCODE_BASIC_INTERNAL_ERROR ); break; @@ -1759,7 +1759,7 @@ bool SbModule::HasExeCode() } bool bRes = false; - if (pImage && !(pImage->GetCodeSize() == 5 && (memcmp(pImage->GetCode(), pEmptyImage, pImage->GetCodeSize()) == 0 ))) + if (pImage && (pImage->GetCodeSize() != 5 || (memcmp(pImage->GetCode(), pEmptyImage, pImage->GetCodeSize()) != 0 ))) bRes = true; return bRes; diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 211d4e325f5b..43352aea3f1f 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -316,7 +316,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) if( pOld ) bRtlSym = true; } - if( pOld && !(eOp == SbiOpcode::REDIM_ || eOp == SbiOpcode::REDIMP_) ) + if( pOld && eOp != SbiOpcode::REDIM_ && eOp != SbiOpcode::REDIMP_ ) { if( pDef->GetScope() == SbLOCAL ) if (auto eOldScope = pOld->GetScope(); eOldScope != SbLOCAL && eOldScope != SbPARAM) @@ -337,7 +337,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) } else if( pOld->GetType() != ( eDefType = pDef->GetType() ) ) { - if( !( eDefType == SbxVARIANT && !pDef->IsDefinedAs() ) ) + if( eDefType != SbxVARIANT || pDef->IsDefinedAs() ) bError_ = true; } if( bError_ ) @@ -352,7 +352,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic ) // #36374: Create the variable in front of the distinction IsNew() // Otherwise error at Dim Identifier As New Type and option explicit - if( !bDefined && !(eOp == SbiOpcode::REDIM_ || eOp == SbiOpcode::REDIMP_) + if( !bDefined && eOp != SbiOpcode::REDIM_ && eOp != SbiOpcode::REDIMP_ && ( !bConst || pDef->GetScope() == SbGLOBAL ) ) { // Declare variable or global constant diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index fe42fa1939a1..58056dd39acd 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -356,7 +356,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp return nullptr; } // Collections may contain objects of the same name - if( !( ct == SbxClassType::Object && dynamic_cast<const SbxCollection*>( this ) != nullptr ) ) + if( ct != SbxClassType::Object || dynamic_cast<const SbxCollection*>( this ) == nullptr ) { SbxVariable* pRes = pArray->Find( rName, ct ); if( pRes ) |