summaryrefslogtreecommitdiff
path: root/cui/source/customize
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/source/customize
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/source/customize')
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx6
-rw-r--r--cui/source/customize/SvxToolbarConfigPage.cxx4
-rw-r--r--cui/source/customize/cfg.cxx2
3 files changed, 6 insertions, 6 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);