summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-04-19 13:13:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-04-19 14:52:50 +0200
commit447a013299d148df12ff17306fff77bb7f85eba1 (patch)
treed577aabfb9b650bc46fdcf2289aae2b1561f1e4e /dbaccess/source/ui
parent78098b8494be7123bc4a8b50faa13445e5afd8ce (diff)
clang-tidy readability-simplify-boolean-expr in dbaccess..framework
Change-Id: I96e1bd4000f4ade6ccfac53c57653772b249df99 Reviewed-on: https://gerrit.libreoffice.org/36678 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx14
-rw-r--r--dbaccess/source/ui/app/AppView.cxx44
-rw-r--r--dbaccess/source/ui/control/tabletree.cxx7
-rw-r--r--dbaccess/source/ui/dlg/advancedsettings.cxx4
-rw-r--r--dbaccess/source/ui/dlg/optionalboolitem.cxx5
-rw-r--r--dbaccess/source/ui/misc/propertysetitem.cxx5
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx5
7 files changed, 27 insertions, 57 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index c53476d3b72f..950fbe17ac46 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -518,15 +518,11 @@ bool OAppDetailPageHelper::isLeaf(SvTreeListEntry* _pEntry)
if ( !_pEntry )
return false;
sal_Int32 nEntryType = reinterpret_cast< sal_IntPtr >( _pEntry->GetUserData() );
- if ( ( nEntryType == DatabaseObjectContainer::TABLES )
- || ( nEntryType == DatabaseObjectContainer::CATALOG )
- || ( nEntryType == DatabaseObjectContainer::SCHEMA )
- || ( nEntryType == DatabaseObjectContainer::FORMS_FOLDER )
- || ( nEntryType == DatabaseObjectContainer::REPORTS_FOLDER )
- )
- return false;
-
- return true;
+ return !( ( nEntryType == DatabaseObjectContainer::TABLES )
+ || ( nEntryType == DatabaseObjectContainer::CATALOG )
+ || ( nEntryType == DatabaseObjectContainer::SCHEMA )
+ || ( nEntryType == DatabaseObjectContainer::FORMS_FOLDER )
+ || ( nEntryType == DatabaseObjectContainer::REPORTS_FOLDER ));
}
bool OAppDetailPageHelper::isALeafSelected() const
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index 389a1bb5d628..6695065bb57e 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -149,22 +149,16 @@ void OAppBorderWindow::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if( true )
- {
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
- aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont(*this, aFont);
- }
- if( true )
- {
- SetTextColor( rStyleSettings.GetFieldTextColor() );
- SetTextFillColor();
- }
+ vcl::Font aFont;
+ aFont = rStyleSettings.GetFieldFont();
+ aFont.SetColor( rStyleSettings.GetWindowTextColor() );
+ SetPointFont(*this, aFont);
+
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+ SetTextFillColor();
- if( true )
- SetBackground( rStyleSettings.GetDialogColor() );
+ SetBackground( rStyleSettings.GetDialogColor() );
}
@@ -547,22 +541,16 @@ void OApplicationView::ImplInitSettings()
{
// FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- if( true )
- {
- vcl::Font aFont;
- aFont = rStyleSettings.GetFieldFont();
- aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont(*this, aFont);
- }
- if( true )
- {
- SetTextColor( rStyleSettings.GetFieldTextColor() );
- SetTextFillColor();
- }
+ vcl::Font aFont;
+ aFont = rStyleSettings.GetFieldFont();
+ aFont.SetColor( rStyleSettings.GetWindowTextColor() );
+ SetPointFont(*this, aFont);
+
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+ SetTextFillColor();
- if( true )
- SetBackground( rStyleSettings.GetFieldColor() );
+ SetBackground( rStyleSettings.GetFieldColor() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index 340e1b863431..cdaddb7069b5 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -87,12 +87,9 @@ void OTableTreeListBox::implSetDefaultImages()
bool OTableTreeListBox::isFolderEntry( const SvTreeListEntry* _pEntry )
{
sal_Int32 nEntryType = reinterpret_cast< sal_IntPtr >( _pEntry->GetUserData() );
- if ( ( nEntryType == DatabaseObjectContainer::TABLES )
+ return ( nEntryType == DatabaseObjectContainer::TABLES )
|| ( nEntryType == DatabaseObjectContainer::CATALOG )
- || ( nEntryType == DatabaseObjectContainer::SCHEMA )
- )
- return true;
- return false;
+ || ( nEntryType == DatabaseObjectContainer::SCHEMA );
}
void OTableTreeListBox::notifyHiContrastChanged()
diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx
index 4a809983887c..3b59fcb383c6 100644
--- a/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -464,9 +464,7 @@ namespace dbaui
{
DataSourceMetaData aMeta( _sURL );
const FeatureSet& rFeatures( aMeta.getFeatureSet() );
- if ( rFeatures.supportsGeneratedValues() || rFeatures.supportsAnySpecialSetting() )
- return true;
- return false;
+ return rFeatures.supportsGeneratedValues() || rFeatures.supportsAnySpecialSetting();
}
short AdvancedSettingsDialog::Execute()
diff --git a/dbaccess/source/ui/dlg/optionalboolitem.cxx b/dbaccess/source/ui/dlg/optionalboolitem.cxx
index ef561f12b779..08acf1c5e51c 100644
--- a/dbaccess/source/ui/dlg/optionalboolitem.cxx
+++ b/dbaccess/source/ui/dlg/optionalboolitem.cxx
@@ -41,10 +41,7 @@ namespace dbaui
if ( !pCompare )
return false;
- if ( m_aValue == pCompare->m_aValue )
- return true;
-
- return false;
+ return m_aValue == pCompare->m_aValue;
}
SfxPoolItem* OptionalBoolItem::Clone( SfxItemPool* /*_pPool*/ ) const
diff --git a/dbaccess/source/ui/misc/propertysetitem.cxx b/dbaccess/source/ui/misc/propertysetitem.cxx
index 26e5dabe70aa..d24ef05247b6 100644
--- a/dbaccess/source/ui/misc/propertysetitem.cxx
+++ b/dbaccess/source/ui/misc/propertysetitem.cxx
@@ -46,10 +46,7 @@ namespace dbaui
bool OPropertySetItem::operator==(const SfxPoolItem& _rItem) const
{
const OPropertySetItem* pCompare = dynamic_cast<const OPropertySetItem*>( &_rItem );
- if ((!pCompare) || (pCompare->m_xSet.get() != m_xSet.get()))
- return false;
-
- return true;
+ return pCompare && (pCompare->m_xSet.get() == m_xSet.get());
}
SfxPoolItem* OPropertySetItem::Clone(SfxItemPool* /* _pPool */) const
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 59733aa125a4..2f48f8edca69 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -174,10 +174,7 @@ bool ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet
if ( nPrimKeysCount != aKeyColumns.getLength() )
return false;
}
- if ( !nPrimKeysCount || nPrimKeysCount != nValidLinesCount )
- return false;
-
- return true;
+ return nPrimKeysCount && nPrimKeysCount == nValidLinesCount;
}
bool ORelationTableConnectionData::IsConnectionPossible()