summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-07-16 13:57:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-07-16 14:00:22 +0200
commit93f0c1fdd8bd618b5f624d33f4ba0b678b9e7f7d (patch)
treee0e3981860462ca7bc6463257a382de038f742be /toolkit
parent7a044db51d35748f17b05f6d80ef90ad9000ad7a (diff)
loplugin:simplifybool
Change-Id: I9875ceec4276382d4bf96bc7e150d594df646602
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxmenu.cxx4
-rw-r--r--toolkit/source/awt/vclxwindows.cxx12
-rw-r--r--toolkit/source/controls/unocontrol.cxx2
-rw-r--r--toolkit/source/controls/unocontrols.cxx2
4 files changed, 10 insertions, 10 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index c30ad50b3858..91db85bd3253 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -390,7 +390,7 @@ throw(css::uno::RuntimeException, std::exception)
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return mpMenu ? mpMenu->IsItemEnabled( nItemId ) : sal_False;
+ return mpMenu && mpMenu->IsItemEnabled( nItemId );
}
void VCLXMenu::setItemText(
@@ -522,7 +522,7 @@ throw(css::uno::RuntimeException, std::exception)
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
- return mpMenu ? mpMenu->IsItemChecked( nItemId ) : sal_False;
+ return mpMenu && mpMenu->IsItemChecked( nItemId );
}
sal_Int16 VCLXMenu::execute(
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index a02ac474f864..c24324f1b799 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -740,7 +740,7 @@ void VCLXImageControl::setProperty( const OUString& PropertyName, const ::com::s
break;
case BASEPROPERTY_SCALEIMAGE:
- aProp <<= ( pImageControl && pImageControl->GetScaleMode() != ImageScaleMode::NONE ) ? sal_True : sal_False;
+ aProp <<= ( pImageControl && pImageControl->GetScaleMode() != ImageScaleMode::NONE );
break;
default:
@@ -1254,7 +1254,7 @@ sal_Bool VCLXRadioButton::getState() throw(::com::sun::star::uno::RuntimeExcepti
SolarMutexGuard aGuard;
VclPtr< RadioButton > pRadioButton = GetAs< RadioButton >();
- return pRadioButton ? pRadioButton->IsChecked() : sal_False;
+ return pRadioButton && pRadioButton->IsChecked();
}
::com::sun::star::awt::Size VCLXRadioButton::getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -3923,7 +3923,7 @@ sal_Bool VCLXEdit::isEditable() throw(::com::sun::star::uno::RuntimeException, s
SolarMutexGuard aGuard;
VclPtr< Edit > pEdit = GetAs< Edit >();
- return ( pEdit && !pEdit->IsReadOnly() && pEdit->IsEnabled() ) ? sal_True : sal_False;
+ return pEdit && !pEdit->IsReadOnly() && pEdit->IsEnabled();
}
void VCLXEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -5042,7 +5042,7 @@ sal_Bool VCLXDateField::isLongFormat() throw(::com::sun::star::uno::RuntimeExcep
SolarMutexGuard aGuard;
VclPtr< DateField > pDateField = GetAs< DateField >();
- return pDateField ? pDateField->IsLongFormat() : sal_False;
+ return pDateField && pDateField->IsLongFormat();
}
void VCLXDateField::setEmpty() throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -5067,7 +5067,7 @@ sal_Bool VCLXDateField::isEmpty() throw(::com::sun::star::uno::RuntimeException,
SolarMutexGuard aGuard;
VclPtr< DateField > pDateField = GetAs< DateField >();
- return pDateField ? pDateField->IsEmptyDate() : sal_False;
+ return pDateField && pDateField->IsEmptyDate();
}
void VCLXDateField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException, std::exception)
@@ -5275,7 +5275,7 @@ sal_Bool VCLXTimeField::isEmpty() throw(::com::sun::star::uno::RuntimeException,
SolarMutexGuard aGuard;
VclPtr< TimeField > pTimeField = GetAs< TimeField >();
- return pTimeField ? pTimeField->IsEmptyTime() : sal_False;
+ return pTimeField && pTimeField->IsEmptyTime();
}
void VCLXTimeField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index 0952e9796086..56e1fc006dcd 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -982,7 +982,7 @@ sal_Bool UnoControl::setGraphics( const Reference< XGraphics >& rDevice ) throw(
mxGraphics = rDevice;
xView.set(getPeer(), css::uno::UNO_QUERY);
}
- return xView.is() ? xView->setGraphics( rDevice ) : sal_True;
+ return !xView.is() || xView->setGraphics( rDevice );
}
Reference< XGraphics > UnoControl::getGraphics( ) throw(RuntimeException, std::exception)
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 1101e57edfa8..8e2d3c982178 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -1311,7 +1311,7 @@ sal_Bool UnoRadioButtonControl::getState() throw(uno::RuntimeException, std::exc
sal_Int16 nState = 0;
uno::Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_STATE ) );
aVal >>= nState;
- return nState ? sal_True : sal_False;
+ return nState != 0;
}
void UnoRadioButtonControl::itemStateChanged( const awt::ItemEvent& rEvent ) throw(uno::RuntimeException, std::exception)