summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-24 12:33:43 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-24 12:36:28 +0200
commitb0d9184ad2dab26e7ee17d8c0ace9f5e5e753026 (patch)
tree9a0161269ba032520c25e2626b8b5ece05160a17
parent94da7fda53562263f960c4ba11644fee7292c2d8 (diff)
loplugin:simplifybool
Change-Id: I3a5554b73c6e9f39a4a903eecf6c59bd3a9a9883
-rw-r--r--svtools/source/config/menuoptions.cxx4
-rw-r--r--svtools/source/contnr/imivctl1.cxx2
-rw-r--r--svtools/source/control/filectrl.cxx10
-rw-r--r--svtools/source/misc/templatefoldercache.cxx4
-rw-r--r--svtools/source/table/tablecontrol.cxx2
-rw-r--r--svtools/source/uno/toolboxcontroller.cxx2
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx4
7 files changed, 12 insertions, 16 deletions
diff --git a/svtools/source/config/menuoptions.cxx b/svtools/source/config/menuoptions.cxx
index de49505ad463..9c0440e6a5cf 100644
--- a/svtools/source/config/menuoptions.cxx
+++ b/svtools/source/config/menuoptions.cxx
@@ -176,7 +176,7 @@ SvtMenuOptions_Impl::SvtMenuOptions_Impl()
else
{
bSystemMenuIcons = false;
- bMenuIcons = m_eMenuIcons ? true : false;
+ bMenuIcons = m_eMenuIcons != TRISTATE_FALSE;
}
// Copy values from list in right order to our internal member.
@@ -249,7 +249,7 @@ void SvtMenuOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
else
{
bSystemMenuIcons = false;
- bMenuIcons = m_eMenuIcons ? true : false;
+ bMenuIcons = m_eMenuIcons != TRISTATE_FALSE;
}
// Step over list of property names and get right value from coreesponding value list to set it on internal members!
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index f7e131aa88bc..ce0e0f1bb285 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2676,7 +2676,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd,
return;
// set flag, so ToTop won't be called in Select
- bool bAlreadySelectingRect = nFlags & F_SELECTING_RECT ? true : false;
+ bool bAlreadySelectingRect = (nFlags & F_SELECTING_RECT) != 0;
nFlags |= F_SELECTING_RECT;
CheckBoundingRects();
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index 31534293e890..7326b3d4aa50 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -157,12 +157,10 @@ void FileControl::Resize()
Size aOutSz = GetOutputSizePixel();
long nButtonTextWidth = maButton.GetTextWidth( maButtonText );
if ( !(mnInternalFlags & FileControlMode_Internal::ORIGINALBUTTONTEXT) ||
- ( nButtonTextWidth < aOutSz.Width()/3 &&
- ( mnFlags & FileControlMode::RESIZEBUTTONBYPATHLEN
- ? ( maEdit.GetTextWidth( maEdit.GetText() )
- <= aOutSz.Width() - nButtonTextWidth - ButtonBorder )
- : true ) )
- )
+ ( nButtonTextWidth < aOutSz.Width()/3 &&
+ ( !( mnFlags & FileControlMode::RESIZEBUTTONBYPATHLEN ) ||
+ ( maEdit.GetTextWidth( maEdit.GetText() )
+ <= aOutSz.Width() - nButtonTextWidth - ButtonBorder ) ) ) )
{
maButton.SetText( maButtonText );
}
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 86fa6fb4a269..f5eb681ea4ab 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -186,9 +186,7 @@ namespace svt
{
bool operator() ( const ::rtl::Reference< TemplateContent >& _rxLHS, const ::rtl::Reference< TemplateContent >& _rxRHS ) const
{
- return _rxLHS->getURL() < _rxRHS->getURL()
- ? true
- : false;
+ return _rxLHS->getURL() < _rxRHS->getURL();
}
};
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index de59f689012d..7ed486a90b48 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -628,7 +628,7 @@ namespace svt { namespace table
Rectangle TableControl::calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen)
{
(void)_bOnScreen;
- return m_pImpl->calcHeaderRect( _bIsColumnBar ? false : true );
+ return m_pImpl->calcHeaderRect( !_bIsColumnBar );
}
diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx
index 48b9d5a575d0..d8bdc68bb902 100644
--- a/svtools/source/uno/toolboxcontroller.cxx
+++ b/svtools/source/uno/toolboxcontroller.cxx
@@ -776,7 +776,7 @@ void ToolboxController::enable( bool bEnable )
sal_uInt16 nItemId = 0;
if( getToolboxId( nItemId, &pToolBox ) )
{
- pToolBox->EnableItem( nItemId, bEnable ? true : false );
+ pToolBox->EnableItem( nItemId, bEnable );
}
}
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index 1a6f0ff0ba23..00efbd5d4ac2 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -506,7 +506,7 @@ void TreeControlPeer::ChangeNodesSelection( const Any& rSelection, bool bSelect,
while( nCount-- )
{
UnoTreeListEntry* pEntry = getEntry( *pNodes++ );
- rTree.Select( pEntry, bSelect ? true : false );
+ rTree.Select( pEntry, bSelect );
}
}
}
@@ -1329,7 +1329,7 @@ void TreeControlPeer::setProperty( const OUString& PropertyName, const Any& aVal
{
bool bEnabled = false;
if( aValue >>= bEnabled )
- rTree.EnableInplaceEditing( bEnabled ? true : false );
+ rTree.EnableInplaceEditing( bEnabled );
break;
}
case BASEPROPERTY_TREE_INVOKESSTOPNODEEDITING: