diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-06 10:16:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-06 10:28:47 +0100 |
commit | 819149fb1f71fc13ffdc288736ce65bb3c6c75d8 (patch) | |
tree | 55e663505dce8b7a36ec5aab1f8d6cc956522cf5 /basic | |
parent | 00055d49f35bbabd46d00fefd395b46872ed45aa (diff) |
loplugin:collapseif in accessibility..cui
Change-Id: I1437b493f3289b4ac97d061bd71973580571e792
Reviewed-on: https://gerrit.libreoffice.org/62933
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 7 | ||||
-rw-r--r-- | basic/source/comp/codegen.cxx | 5 | ||||
-rw-r--r-- | basic/source/comp/parser.cxx | 9 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 14 | ||||
-rw-r--r-- | basic/source/sbx/sbxexec.cxx | 7 |
5 files changed, 13 insertions, 29 deletions
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 9aa7725aca74..961c1a7f52e1 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3603,11 +3603,8 @@ void SbUnoService::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pAnyArgs[i] = sbxToUnoValue( pParams->Get( iSbx ), aType ); // Check for out parameter if not already done - if( !bOutParams ) - { - if( xParam->isOut() ) - bOutParams = true; - } + if( !bOutParams && xParam->isOut() ) + bOutParams = true; } else { diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 7cc715f7fa8e..e73700e5cedf 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -515,9 +515,8 @@ public: virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) override { m_ConvertedBuf += static_cast<sal_uInt8>(eOp); - if ( eOp == SbiOpcode::CASEIS_ ) - if ( nOp1 ) - nOp1 = static_cast<T>( convertBufferOffSet(m_pStart, nOp1) ); + if ( eOp == SbiOpcode::CASEIS_ && nOp1 ) + nOp1 = static_cast<T>( convertBufferOffSet(m_pStart, nOp1) ); m_ConvertedBuf += static_cast<S>(nOp1); m_ConvertedBuf += static_cast<S>(nOp2); diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index caca02573343..fcf524a8057a 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -762,13 +762,10 @@ void SbiParser::Option() case BASIC_EXPLICIT: bExplicit = true; break; case BASE: - if( Next() == NUMBER ) + if( Next() == NUMBER && ( nVal == 0 || nVal == 1 ) ) { - if( nVal == 0 || nVal == 1 ) - { - nBase = static_cast<short>(nVal); - break; - } + nBase = static_cast<short>(nVal); + break; } Error( ERRCODE_BASIC_EXPECTED, "0/1" ); break; diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index be501d946071..69dae820aad8 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -3204,11 +3204,8 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, bOk = checkUnoObjectType(*pUnoObj, aClass); else bOk = false; - if ( !bOk ) - { - if( bRaiseErrors ) - Error( ERRCODE_BASIC_INVALID_USAGE_OBJECT ); - } + if ( !bOk && bRaiseErrors ) + Error( ERRCODE_BASIC_INVALID_USAGE_OBJECT ); } else { @@ -3337,12 +3334,9 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt } if( bLocal ) { - if ( bStatic ) + if ( bStatic && pMeth ) { - if ( pMeth ) - { - pElem = pMeth->GetStatics()->Find( aName, SbxClassType::DontCare ); - } + pElem = pMeth->GetStatics()->Find( aName, SbxClassType::DontCare ); } if ( !pElem ) diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index efbd45052df8..f2f23049dcb6 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -150,12 +150,9 @@ static SbxVariableRef Operand return nullptr; } // Double quotes are OK - if( *p == '"' ) + if( *p == '"' && (*++p) != '"' ) { - if( *++p != '"' ) - { - break; - } + break; } aString.append(*p++); } |