summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-24 12:34:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-24 12:36:29 +0200
commite710c1dbfb87a54d666752db1106b76e9e05ba43 (patch)
tree26d4a229f6dff683bb7e72afc8cdbc8d6f4d7c76
parent746a717ed4648cd6c0d0d810a90a6539373b130c (diff)
loplugin:simplifybool
Change-Id: Ib238714477fdeadad07c470e1d9ed64b2b18f25d
-rw-r--r--toolkit/source/awt/vclxfont.cxx2
-rw-r--r--toolkit/source/awt/vclxwindows.cxx6
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx2
-rw-r--r--toolkit/source/helper/property.cxx2
-rw-r--r--toolkit/source/helper/unopropertyarrayhelper.cxx2
-rw-r--r--toolkit/source/helper/unowrapper.cxx2
6 files changed, 8 insertions, 8 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx
index a0628c0f22b3..9aece8bc85c6 100644
--- a/toolkit/source/awt/vclxfont.cxx
+++ b/toolkit/source/awt/vclxfont.cxx
@@ -66,7 +66,7 @@ bool VCLXFont::ImplAssertValidFontMetric()
pOutDev->SetFont( aOldFont );
}
}
- return mpFontMetric ? true : false;
+ return mpFontMetric != nullptr;
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index e0cedc4963ff..a8c8cc0c4cd5 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -1140,7 +1140,7 @@ void VCLXRadioButton::setProperty( const OUString& PropertyName, const ::com::su
sal_Int16 n = sal_Int16();
if ( Value >>= n )
{
- bool b = n ? true : false;
+ bool b = n != 0;
if ( pButton->IsRadioCheckEnabled() )
pButton->Check( b );
else
@@ -1807,7 +1807,7 @@ void VCLXListBox::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
if( pListBox )
{
- bool bDropDown = ( pListBox->GetStyle() & WB_DROPDOWN ) ? true : false;
+ bool bDropDown = ( pListBox->GetStyle() & WB_DROPDOWN ) != 0;
if ( bDropDown && !IsSynthesizingVCLEvent() && maActionListeners.getLength() )
{
// Call ActionListener on DropDown event
@@ -4690,7 +4690,7 @@ void VCLXFormattedSpinField::setStrictFormat( bool bStrict )
bool VCLXFormattedSpinField::isStrictFormat()
{
FormatterBase* pFormatter = GetFormatter();
- return pFormatter ? pFormatter->IsStrictFormat() : false;
+ return pFormatter && pFormatter->IsStrictFormat();
}
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 8d7ec07416c4..8e5949fe4f2a 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -150,7 +150,7 @@ bool UnoControlModel::ImplHasProperty( sal_uInt16 nPropId ) const
if ( ( nPropId >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( nPropId <= BASEPROPERTY_FONTDESCRIPTORPART_END ) )
nPropId = BASEPROPERTY_FONTDESCRIPTOR;
- return maData.find( nPropId ) != maData.end() ? true : false;
+ return maData.find( nPropId ) != maData.end();
}
::com::sun::star::uno::Any UnoControlModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
diff --git a/toolkit/source/helper/property.cxx b/toolkit/source/helper/property.cxx
index e1144e463b4f..b71916d20b71 100644
--- a/toolkit/source/helper/property.cxx
+++ b/toolkit/source/helper/property.cxx
@@ -385,7 +385,7 @@ bool DoesDependOnOthers( sal_uInt16 nPropertyId )
{
const ImplPropertyInfo* pImplPropertyInfo = ImplGetImplPropertyInfo( nPropertyId );
DBG_ASSERT( pImplPropertyInfo, "Invalid PropertyId!" );
- return pImplPropertyInfo ? pImplPropertyInfo->bDependsOnOthers : false;
+ return pImplPropertyInfo && pImplPropertyInfo->bDependsOnOthers;
}
bool CompareProperties( const ::com::sun::star::uno::Any& r1, const ::com::sun::star::uno::Any& r2 )
diff --git a/toolkit/source/helper/unopropertyarrayhelper.cxx b/toolkit/source/helper/unopropertyarrayhelper.cxx
index d8658952590a..c1c3c6a2c162 100644
--- a/toolkit/source/helper/unopropertyarrayhelper.cxx
+++ b/toolkit/source/helper/unopropertyarrayhelper.cxx
@@ -46,7 +46,7 @@ bool UnoPropertyArrayHelper::ImplHasProperty( sal_uInt16 nPropId ) const
if ( ( nPropId >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( nPropId <= BASEPROPERTY_FONTDESCRIPTORPART_END ) )
nPropId = BASEPROPERTY_FONTDESCRIPTOR;
- return maIDs.find( nPropId ) != maIDs.end() ? true : false;
+ return maIDs.find( nPropId ) != maIDs.end();
}
// ::cppu::IPropertyArrayHelper
diff --git a/toolkit/source/helper/unowrapper.cxx b/toolkit/source/helper/unowrapper.cxx
index 5cdcbfe0e120..3681847a26f9 100644
--- a/toolkit/source/helper/unowrapper.cxx
+++ b/toolkit/source/helper/unowrapper.cxx
@@ -212,7 +212,7 @@ static bool lcl_ImplIsParent( vcl::Window* pParentWindow, vcl::Window* pPossible
while ( pWindow && ( pWindow != pParentWindow ) )
pWindow = pWindow->GetParent();
- return pWindow ? true : false;
+ return pWindow != nullptr;
}
void UnoWrapper::WindowDestroyed( vcl::Window* pWindow )