From a60ffa6985dec32cc73032a7774f58694a6ee9a7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 20 Nov 2017 09:25:11 +0200 Subject: loplugin:flatten in sw Change-Id: I64176f48d90303f078e326c8838da9eb2daf8126 Reviewed-on: https://gerrit.libreoffice.org/44937 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/ui/config/optload.cxx | 47 +++++++++++++++++++++-------------------- sw/source/ui/config/optpage.cxx | 37 ++++++++++++++++---------------- 2 files changed, 43 insertions(+), 41 deletions(-) (limited to 'sw/source/ui/config') diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 1824dc7ab7ac..544aa7e7fe20 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -807,30 +807,31 @@ IMPL_LINK_NOARG(SwCaptionOptPage, SaveEntryHdl, SvTreeListBox*, void) void SwCaptionOptPage::SaveEntry(SvTreeListEntry const * pEntry) { - if (pEntry) - { - InsCaptionOpt* pOpt = static_cast(pEntry->GetUserData()); + if (!pEntry) + return; + + InsCaptionOpt* pOpt = static_cast(pEntry->GetUserData()); + + pOpt->UseCaption() = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pEntry)); + const OUString aName( m_pCategoryBox->GetText() ); + if (aName == m_sNone) + pOpt->SetCategory(""); + else + pOpt->SetCategory(comphelper::string::strip(aName, ' ')); + pOpt->SetNumType((sal_uInt16)reinterpret_cast(m_pFormatBox->GetSelectedEntryData())); + pOpt->SetCaption(m_pTextEdit->IsEnabled() ? m_pTextEdit->GetText() : OUString() ); + pOpt->SetPos(m_pPosBox->GetSelectedEntryPos()); + sal_Int32 nPos = m_pLbLevel->GetSelectedEntryPos(); + sal_Int32 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; + pOpt->SetLevel(nLevel); + pOpt->SetSeparator(m_pEdDelim->GetText()); + pOpt->SetNumSeparator( m_pNumberingSeparatorED->GetText()); + if(!m_pCharStyleLB->GetSelectedEntryPos()) + pOpt->SetCharacterStyle(""); + else + pOpt->SetCharacterStyle(m_pCharStyleLB->GetSelectedEntry()); + pOpt->CopyAttributes() = m_pApplyBorderCB->IsChecked(); - pOpt->UseCaption() = m_pCheckLB->IsChecked(m_pCheckLB->GetModel()->GetAbsPos(pEntry)); - const OUString aName( m_pCategoryBox->GetText() ); - if (aName == m_sNone) - pOpt->SetCategory(""); - else - pOpt->SetCategory(comphelper::string::strip(aName, ' ')); - pOpt->SetNumType((sal_uInt16)reinterpret_cast(m_pFormatBox->GetSelectedEntryData())); - pOpt->SetCaption(m_pTextEdit->IsEnabled() ? m_pTextEdit->GetText() : OUString() ); - pOpt->SetPos(m_pPosBox->GetSelectedEntryPos()); - sal_Int32 nPos = m_pLbLevel->GetSelectedEntryPos(); - sal_Int32 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; - pOpt->SetLevel(nLevel); - pOpt->SetSeparator(m_pEdDelim->GetText()); - pOpt->SetNumSeparator( m_pNumberingSeparatorED->GetText()); - if(!m_pCharStyleLB->GetSelectedEntryPos()) - pOpt->SetCharacterStyle(""); - else - pOpt->SetCharacterStyle(m_pCharStyleLB->GetSelectedEntry()); - pOpt->CopyAttributes() = m_pApplyBorderCB->IsChecked(); - } } IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl, Edit&, void) diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index a603ef992b81..b30f1bc72127 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1356,25 +1356,26 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage( vcl::Window* pParent, m_pFillSpaceRB->Check( FILL_SPACE == eMode ); m_pFillTabAndSpaceRB->Check( FILL_TAB_SPACE == eMode ); - if(SfxItemState::SET == rSet.GetItemState(SID_HTML_MODE, false, &pItem ) - && static_cast(pItem)->GetValue() & HTMLMODE_ON) - { - m_pTabCB->Hide(); - m_pCharHiddenCB->Hide(); - m_pFieldHiddenCB->Hide(); - m_pFieldHiddenParaCB->Hide(); + if(SfxItemState::SET != rSet.GetItemState(SID_HTML_MODE, false, &pItem ) + || !(static_cast(pItem)->GetValue() & HTMLMODE_ON)) + return; + + m_pTabCB->Hide(); + m_pCharHiddenCB->Hide(); + m_pFieldHiddenCB->Hide(); + m_pFieldHiddenParaCB->Hide(); + + m_pDirectCursorFrame->Hide(); + m_pOnOffCB->Hide(); + m_pFillMarginRB->Hide(); + m_pFillIndentRB->Hide(); + m_pFillTabRB->Hide(); + m_pFillSpaceRB->Hide(); + m_pFillTabAndSpaceRB->Hide(); + + m_pCursorProtFrame->Hide(); + m_pCursorInProtCB->Hide(); - m_pDirectCursorFrame->Hide(); - m_pOnOffCB->Hide(); - m_pFillMarginRB->Hide(); - m_pFillIndentRB->Hide(); - m_pFillTabRB->Hide(); - m_pFillSpaceRB->Hide(); - m_pFillTabAndSpaceRB->Hide(); - - m_pCursorProtFrame->Hide(); - m_pCursorInProtCB->Hide(); - } } SwShdwCursorOptionsTabPage::~SwShdwCursorOptionsTabPage() -- cgit v1.2.3