summaryrefslogtreecommitdiff
path: root/sw/source/ui/config
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:38:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 21:37:05 +0200
commit51735e6946dca0528a4b78d06ef43bd84c38e5e1 (patch)
tree1199c84c158e5512205488d30e73bf0f30fd8a0d /sw/source/ui/config
parentc0a4af22ed3cac188274fe51cbf3bcfe47d6acf8 (diff)
loplugin:flatten in sw/ui/dbui
Change-Id: Iab627f306a1caf52237369471393753bf2c736f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/config')
-rw-r--r--sw/source/ui/config/optcomp.cxx26
-rw-r--r--sw/source/ui/config/optload.cxx26
-rw-r--r--sw/source/ui/config/optpage.cxx26
3 files changed, 39 insertions, 39 deletions
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 293e798e09b4..ac0d1c3ed063 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -268,24 +268,24 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, weld::Button&, void)
{
std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/querydefaultcompatdialog.ui"));
std::unique_ptr<weld::MessageDialog> xQueryBox(xBuilder->weld_message_dialog("QueryDefaultCompatDialog"));
- if (xQueryBox->run() == RET_YES)
+ if (xQueryBox->run() != RET_YES)
+ return;
+
+ auto pItem = std::find_if(m_pImpl->m_aList.begin(), m_pImpl->m_aList.end(),
+ [](const SvtCompatibilityEntry& rItem) { return rItem.isDefaultEntry(); });
+ if (pItem != m_pImpl->m_aList.end())
{
- auto pItem = std::find_if(m_pImpl->m_aList.begin(), m_pImpl->m_aList.end(),
- [](const SvtCompatibilityEntry& rItem) { return rItem.isDefaultEntry(); });
- if (pItem != m_pImpl->m_aList.end())
+ const sal_Int32 nCount = m_xOptionsLB->n_children();
+ for ( sal_Int32 i = 0; i < nCount; ++i )
{
- const sal_Int32 nCount = m_xOptionsLB->n_children();
- for ( sal_Int32 i = 0; i < nCount; ++i )
- {
- bool bChecked = m_xOptionsLB->get_toggle(i);
+ bool bChecked = m_xOptionsLB->get_toggle(i);
- int nCoptIdx = i + 2; /* Consider "Name" & "Module" indexes */
- pItem->setValue<bool>( SvtCompatibilityEntry::Index(nCoptIdx), bChecked );
- }
+ int nCoptIdx = i + 2; /* Consider "Name" & "Module" indexes */
+ pItem->setValue<bool>( SvtCompatibilityEntry::Index(nCoptIdx), bChecked );
}
-
- WriteOptions();
}
+
+ WriteOptions();
}
void SwCompatibilityOptPage::SetCurrentOptions( sal_uInt32 nOptions )
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 9a5d934367a7..25b93c773e15 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -349,19 +349,19 @@ void SwLoadOptPage::Reset( const SfxItemSet* rSet)
IMPL_LINK_NOARG(SwLoadOptPage, MetricHdl, weld::ComboBox&, void)
{
const sal_Int32 nMPos = m_xMetricLB->get_active();
- if(nMPos != -1)
- {
- // Double-Cast for VA3.0
- FieldUnit eFieldUnit = static_cast<FieldUnit>(m_xMetricLB->get_id(nMPos).toUInt32());
- bool bModified = m_xTabMF->get_value_changed_from_saved();
- long nVal = bModified ?
- sal::static_int_cast<sal_Int32, sal_Int64 >( m_xTabMF->denormalize( m_xTabMF->get_value( FieldUnit::TWIP ) )) :
- m_nLastTab;
- ::SetFieldUnit( *m_xTabMF, eFieldUnit );
- m_xTabMF->set_value( m_xTabMF->normalize( nVal ), FieldUnit::TWIP );
- if (!bModified)
- m_xTabMF->save_value();
- }
+ if(nMPos == -1)
+ return;
+
+ // Double-Cast for VA3.0
+ FieldUnit eFieldUnit = static_cast<FieldUnit>(m_xMetricLB->get_id(nMPos).toUInt32());
+ bool bModified = m_xTabMF->get_value_changed_from_saved();
+ long nVal = bModified ?
+ sal::static_int_cast<sal_Int32, sal_Int64 >( m_xTabMF->denormalize( m_xTabMF->get_value( FieldUnit::TWIP ) )) :
+ m_nLastTab;
+ ::SetFieldUnit( *m_xTabMF, eFieldUnit );
+ m_xTabMF->set_value( m_xTabMF->normalize( nVal ), FieldUnit::TWIP );
+ if (!bModified)
+ m_xTabMF->save_value();
}
SwCaptionOptDlg::SwCaptionOptDlg(weld::Window* pParent, const SfxItemSet& rSet)
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index fda991a7abfb..1fff3ebb657b 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -2173,20 +2173,20 @@ void SwTestTabPage::Reset( const SfxItemSet* )
const SfxItemSet& rSet = GetItemSet();
const SwTestItem* pTestAttr = nullptr;
- if( SfxItemState::SET == rSet.GetItemState( FN_PARAM_SWTEST , false,
+ if( SfxItemState::SET != rSet.GetItemState( FN_PARAM_SWTEST , false,
reinterpret_cast<const SfxPoolItem**>(&pTestAttr) ))
- {
- m_xTest1CBox->set_active(pTestAttr->m_bTest1);
- m_xTest2CBox->set_active(pTestAttr->m_bTest2);
- m_xTest3CBox->set_active(pTestAttr->m_bTest3);
- m_xTest4CBox->set_active(pTestAttr->m_bTest4);
- m_xTest5CBox->set_active(pTestAttr->m_bTest5);
- m_xTest6CBox->set_active(pTestAttr->m_bTest6);
- m_xTest7CBox->set_active(pTestAttr->m_bTest7);
- m_xTest8CBox->set_active(pTestAttr->m_bTest8);
- m_xTest9CBox->set_active(pTestAttr->m_bTest9);
- m_xTest10CBox->set_active(pTestAttr->m_bTest10);
- }
+ return;
+
+ m_xTest1CBox->set_active(pTestAttr->m_bTest1);
+ m_xTest2CBox->set_active(pTestAttr->m_bTest2);
+ m_xTest3CBox->set_active(pTestAttr->m_bTest3);
+ m_xTest4CBox->set_active(pTestAttr->m_bTest4);
+ m_xTest5CBox->set_active(pTestAttr->m_bTest5);
+ m_xTest6CBox->set_active(pTestAttr->m_bTest6);
+ m_xTest7CBox->set_active(pTestAttr->m_bTest7);
+ m_xTest8CBox->set_active(pTestAttr->m_bTest8);
+ m_xTest9CBox->set_active(pTestAttr->m_bTest9);
+ m_xTest10CBox->set_active(pTestAttr->m_bTest10);
}
void SwTestTabPage::Init()