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>
This commit is contained in:
Noel Grandin 2020-05-27 14:49:41 +02:00
parent e871c9cb7c
commit 5f19287a9c
11 changed files with 21 additions and 21 deletions

View file

@ -88,7 +88,7 @@ namespace accessibility
void AccessibleTabBarPageList::UpdatePageText( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@ -106,7 +106,7 @@ namespace accessibility
void AccessibleTabBarPageList::InsertChild( sal_Int32 i )
{
if ( !(i >= 0 && i <= static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// insert entry in child list
@ -125,7 +125,7 @@ namespace accessibility
void AccessibleTabBarPageList::RemoveChild( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// get the accessible of the removed page

View file

@ -409,7 +409,7 @@ void OAccessibleMenuBaseComponent::InsertChild( sal_Int32 i )
void OAccessibleMenuBaseComponent::RemoveChild( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// keep the accessible of the removed item

View file

@ -62,7 +62,7 @@ void VCLXAccessibleStatusBar::UpdateShowing( sal_Int32 i, bool bShowing )
void VCLXAccessibleStatusBar::UpdateItemName( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@ -80,7 +80,7 @@ void VCLXAccessibleStatusBar::UpdateItemName( sal_Int32 i )
void VCLXAccessibleStatusBar::UpdateItemText( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
@ -98,7 +98,7 @@ void VCLXAccessibleStatusBar::UpdateItemText( sal_Int32 i )
void VCLXAccessibleStatusBar::InsertChild( sal_Int32 i )
{
if ( !(i >= 0 && i <= static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// insert entry in child list
@ -117,7 +117,7 @@ void VCLXAccessibleStatusBar::InsertChild( sal_Int32 i )
void VCLXAccessibleStatusBar::RemoveChild( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// get the accessible of the removed page

View file

@ -116,7 +116,7 @@ void VCLXAccessibleTabControl::UpdateTabPage( sal_Int32 i, bool bNew )
void VCLXAccessibleTabControl::InsertChild( sal_Int32 i )
{
if ( !(i >= 0 && i <= static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i > static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// insert entry in child list
@ -135,7 +135,7 @@ void VCLXAccessibleTabControl::InsertChild( sal_Int32 i )
void VCLXAccessibleTabControl::RemoveChild( sal_Int32 i )
{
if ( !(i >= 0 && i < static_cast<sal_Int32>(m_aAccessibleChildren.size())) )
if ( i < 0 || i >= static_cast<sal_Int32>(m_aAccessibleChildren.size()) )
return;
// get the accessible of the removed page

View file

@ -487,8 +487,8 @@ void Shell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
return;
const SfxHintId nHintId = pSbxHint->GetId();
if ( !(( nHintId == SfxHintId::BasicStart ) ||
( nHintId == SfxHintId::BasicStop )) )
if ( ( nHintId != SfxHintId::BasicStart ) &&
( nHintId != SfxHintId::BasicStop ) )
return;
if (SfxBindings* pBindings = GetBindingsPtr())

View file

@ -47,7 +47,7 @@ bool lcl_ParseText(OUString const &rText, size_t& rLineNr )
if (aText.isEmpty())
return false;
sal_Unicode cFirst = aText[0];
if (cFirst != '#' && !(cFirst >= '0' && cFirst <= '9'))
if (cFirst != '#' && (cFirst < '0' || cFirst > '9'))
return false;
if (cFirst == '#')
aText = aText.copy(1);

View file

@ -278,7 +278,7 @@ namespace basegfx
const sal_uInt32 nPointCountA(rCandidateA.count());
const sal_uInt32 nPointCountB(rCandidateB.count());
if(!(nPointCountA > 1 && nPointCountB > 1))
if(nPointCountA <= 1 || nPointCountB <= 1)
return;
const sal_uInt32 nEdgeCountA(nPointCountA - 1);

View file

@ -93,7 +93,7 @@ namespace basegfx::utils
bool bRelative(false);
const sal_Unicode aCurrChar(rSvgDStatement[nPos]);
if(o_rPolyPolygon.count() && !aCurrPoly.count() && !(aCurrChar == 'm' || aCurrChar == 'M'))
if(o_rPolyPolygon.count() && !aCurrPoly.count() && aCurrChar != 'm' && aCurrChar != 'M')
{
// we have a new sub-polygon starting, but without a 'moveto' command.
// this requires to add the current point as start point to the polygon

View file

@ -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;

View file

@ -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

View file

@ -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 )