summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-27 14:50:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-28 09:04:51 +0200
commite871c9cb7ce4f3df2ba6780be62ed46b5ee7a410 (patch)
tree9204fac0ea61289899129c30582f3a108680f6a3 /cui
parent41d8b41767032681a9897b7551f011d450e3725e (diff)
loplugin:simplifybool in canvas..cui
Change-Id: Ib7c3b381ce4456e3d48538ee6f762ceaf2784fe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94973 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx6
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx4
-rw-r--r--cui/source/customize/cfg.cxx2
-rw-r--r--cui/source/options/optlingu.cxx2
-rw-r--r--cui/source/tabpages/page.cxx2
-rw-r--r--cui/source/tabpages/tpcolor.cxx2
6 files changed, 9 insertions, 9 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index a0c6d316a0e5..c40c07dd3ce6 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -172,7 +172,7 @@ void SvxMenuConfigPage::UpdateButtonStates()
bool bIsSeparator =
selection != -1 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(selection).toInt64())->IsSeparator();
bool bIsValidSelection =
- !(m_xContentsListBox->n_children() == 0 || selection == -1);
+ (m_xContentsListBox->n_children() != 0 && selection != -1);
m_xMoveUpButton->set_sensitive(
bIsValidSelection && selection != 0 );
@@ -489,7 +489,7 @@ IMPL_LINK_NOARG(SvxMenuConfigPage, ResetMenuHdl, weld::Button&, void)
// Resetting individual top-level menus is not possible at the moment.
// So we are resetting only if it is a context menu
- if (!(!m_bIsMenuBar && xQueryBox->run() == RET_YES))
+ if (m_bIsMenuBar || xQueryBox->run() != RET_YES)
return;
sal_Int32 nPos = m_xTopLevelListBox->get_active();
@@ -538,7 +538,7 @@ IMPL_LINK( SvxMenuConfigPage, ContentContextMenuHdl, const CommandEvent&, rCEvt,
bool bIsSeparator =
nSelectIndex != -1 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(nSelectIndex).toInt64())->IsSeparator();
bool bIsValidSelection =
- !( m_xContentsListBox->n_children() == 0 || nSelectIndex == -1 );
+ ( m_xContentsListBox->n_children() != 0 && nSelectIndex != -1 );
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder( &rTreeView, "cui/ui/entrycontextmenu.ui" ) );
auto xContextMenu = xBuilder->weld_menu("menu");
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx
index dfe66d4e3721..7bc2115b36fa 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -717,7 +717,7 @@ void SvxToolbarConfigPage::UpdateButtonStates()
bool bIsSeparator =
selection != -1 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(selection).toInt64())->IsSeparator();
bool bIsValidSelection =
- !(m_xContentsListBox->n_children() == 0 || selection == -1);
+ (m_xContentsListBox->n_children() != 0 && selection != -1);
m_xMoveUpButton->set_sensitive( bIsValidSelection );
m_xMoveDownButton->set_sensitive( bIsValidSelection );
@@ -905,7 +905,7 @@ IMPL_LINK( SvxToolbarConfigPage, ContentContextMenuHdl, const CommandEvent&, rCE
bool bIsSeparator =
nSelectIndex != -1 && reinterpret_cast<SvxConfigEntry*>(m_xContentsListBox->get_id(nSelectIndex).toInt64())->IsSeparator();
bool bIsValidSelection =
- !( m_xContentsListBox->n_children() == 0 || nSelectIndex == -1 );
+ ( m_xContentsListBox->n_children() != 0 && nSelectIndex != -1 );
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder( &rTreeView, "cui/ui/entrycontextmenu.ui" ) );
auto xContextMenu = xBuilder->weld_menu("menu");
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 6b2a83d38dc3..d581a95e9ec0 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1974,7 +1974,7 @@ void ToolbarSaveInData::SetSystemStyle(
window = VCLUnoHelper::GetWindow( xWindow ).get();
}
- if ( !(window != nullptr && window->GetType() == WindowType::TOOLBOX) )
+ if ( window == nullptr || window->GetType() != WindowType::TOOLBOX )
return;
ToolBox* toolbox = static_cast<ToolBox*>(window);
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 296451e6a380..3a45faab808e 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1625,7 +1625,7 @@ IMPL_LINK( SvxEditModulesDlg, BoxCheckButtonHdl_Impl, const row_col&, rRowCol, v
{
auto nPos = rRowCol.first;
ModuleUserData_Impl* pData = reinterpret_cast<ModuleUserData_Impl*>(m_xModulesCLB->get_id(nPos).toInt64());
- if (!(!pData->IsParent() && pData->GetType() == TYPE_HYPH))
+ if (pData->IsParent() || pData->GetType() != TYPE_HYPH)
return;
// make hyphenator checkboxes function as radio-buttons
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 1b5fc2851ce9..06820ba647d5 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -1376,7 +1376,7 @@ void SvxPageDescPage::CalcMargin_Impl()
long nWidth = nBL + nBR + MINBODY;
long nHeight = nBT + nBB + MINBODY;
- if ( !(nWidth > nW || nHeight > nH) )
+ if ( nWidth <= nW && nHeight <= nH )
return;
if ( nWidth > nW )
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 5933985a9b50..8a79dcd44c9e 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -398,7 +398,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, weld::Button&, void)
{
sal_uInt16 nId = m_xValSetColorList->GetSelectedItemId();
size_t nPos = m_xValSetColorList->GetSelectItemPos();
- if (!(m_xSelectPalette->get_active() == 0 && nPos != VALUESET_ITEM_NOTFOUND) )
+ if (m_xSelectPalette->get_active() != 0 || nPos == VALUESET_ITEM_NOTFOUND)
return;
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));