diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-08 16:10:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-09 12:26:44 +0100 |
commit | 65d2d2647ead42e5bbb7800f14c047f383fe450b (patch) | |
tree | adf4a55eed10f800ed62a686826f9cbbd6effdd2 /sw/source/ui | |
parent | 0f68e45e2ec6b9fa8c562044e88355d95af0347d (diff) |
loplugin:singlevalfields in sw
Change-Id: Icdb155f9fa7ae79fc193c2da436d9500e7be4d29
Reviewed-on: https://gerrit.libreoffice.org/63126
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 02eb3015af0b..b6b02eb1c928 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -534,11 +534,8 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent, m_bSetIdxDefault(true), m_bListHeightDefault (false), - m_bSetListHeightDefault (false), m_bLabelHeightDefault (false), - m_bSetLabelHeightDefault(false), m_bIndexHeightDefault (false), - m_bSetIndexHeightDefault (false), m_nFontGroup(FONT_GROUP_DEFAULT), @@ -576,13 +573,6 @@ SwStdFontTabPage::SwStdFontTabPage( vcl::Window* pParent, m_pListBox ->SetLoseFocusHdl( aFocusLink ); m_pLabelBox ->SetLoseFocusHdl( aFocusLink ); m_pIdxBox ->SetLoseFocusHdl( aFocusLink ); - - Link<Edit&,void> aModifyHeightLink( LINK( this, SwStdFontTabPage, ModifyHeightHdl)); - m_pStandardHeightLB->SetModifyHdl( aModifyHeightLink ); - m_pTitleHeightLB-> SetModifyHdl( aModifyHeightLink ); - m_pListHeightLB-> SetModifyHdl( aModifyHeightLink ); - m_pLabelHeightLB-> SetModifyHdl( aModifyHeightLink ); - m_pIndexHeightLB-> SetModifyHdl( aModifyHeightLink ); } SwStdFontTabPage::~SwStdFontTabPage() @@ -648,9 +638,9 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) bool bStandardHeightChanged = m_pStandardHeightLB->IsValueChangedFromSaved(); bool bTitleHeightChanged = m_pTitleHeightLB->IsValueChangedFromSaved(); - bool bListHeightChanged = m_pListHeightLB->IsValueChangedFromSaved() && (!m_bListHeightDefault || !m_bSetListHeightDefault ); - bool bLabelHeightChanged = m_pLabelHeightLB->IsValueChangedFromSaved() && (!m_bLabelHeightDefault || !m_bSetLabelHeightDefault ); - bool bIndexHeightChanged = m_pIndexHeightLB->IsValueChangedFromSaved() && (!m_bIndexHeightDefault || !m_bSetIndexHeightDefault ); + bool bListHeightChanged = m_pListHeightLB->IsValueChangedFromSaved() && !m_bListHeightDefault; + bool bLabelHeightChanged = m_pLabelHeightLB->IsValueChangedFromSaved() && !m_bLabelHeightDefault; + bool bIndexHeightChanged = m_pIndexHeightLB->IsValueChangedFromSaved() && !m_bIndexHeightDefault; m_pFontConfig->SetFontStandard(sStandard, m_nFontGroup); m_pFontConfig->SetFontOutline(sTitle, m_nFontGroup); @@ -1006,32 +996,6 @@ IMPL_LINK( SwStdFontTabPage, ModifyHdl, Edit&, rBox, void ) } } -IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, Edit&, rBox, void ) -{ - if(&rBox == m_pStandardHeightLB) - { - sal_Int64 nValue = static_cast<FontSizeBox&>(rBox).GetValue(FieldUnit::TWIP); - if(m_bSetListHeightDefault && m_bListHeightDefault) - m_pListHeightLB->SetValue(nValue, FieldUnit::TWIP); - if(m_bSetLabelHeightDefault && m_bLabelHeightDefault) - m_pLabelHeightLB->SetValue(nValue, FieldUnit::TWIP); - if(m_bSetIndexHeightDefault && m_bIndexHeightDefault) - m_pIndexHeightLB->SetValue(nValue, FieldUnit::TWIP); - } - else if(&rBox == m_pListHeightLB) - { - m_bSetListHeightDefault = false; - } - else if(&rBox == m_pLabelHeightLB) - { - m_bSetLabelHeightDefault = false; - } - else if(&rBox == m_pIndexHeightLB) - { - m_bSetIndexHeightDefault = false; - } -} - IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, Control&, rControl, void ) { ComboBox* pBox = static_cast<ComboBox*>(&rControl); |