diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-17 14:48:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-17 15:50:58 +0200 |
commit | 3e57aad962c9d24c535daff893db203314709cfc (patch) | |
tree | 5744fcaae69751cdd4174f5da6024ba656e77ccc /cui/source/tabpages/backgrnd.cxx | |
parent | bb3ea0ae51bb943f7bb3dca80eee153f9c55c03e (diff) |
loplugin:flatten in cui
Change-Id: I0ea0784ab8c4542747da1e15fa7c60c60bccb602
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92423
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/tabpages/backgrnd.cxx')
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index e72ddcb4854b..123481198e17 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -290,52 +290,52 @@ IMPL_LINK(SvxBkgTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, void) } sal_Int32 nSelPos = rBox.get_active(); - if (m_nActPos != nSelPos) + if (m_nActPos == nSelPos) + return; + + m_nActPos = nSelPos; + + // fill local item set with XATTR_FILL created from SvxBushItem for table destination slot Which + sal_uInt16 nWhich = maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(nSelPos)); + if (SfxItemState::SET == maSet.GetItemState(nWhich)) + { + SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich))); + setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, maSet); + } + else { - m_nActPos = nSelPos; + SelectFillType(*m_xBtnNone, &maSet); + return; + } - // fill local item set with XATTR_FILL created from SvxBushItem for table destination slot Which - sal_uInt16 nWhich = maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(nSelPos)); - if (SfxItemState::SET == maSet.GetItemState(nWhich)) - { - SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich))); - setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, maSet); - } - else + // show tab page + drawing::FillStyle eXFS = drawing::FillStyle_NONE; + if (maSet.GetItemState(XATTR_FILLSTYLE) != SfxItemState::DONTCARE) + { + XFillStyleItem aFillStyleItem(static_cast<const XFillStyleItem&>(maSet.Get(GetWhich( XATTR_FILLSTYLE)))); + eXFS = aFillStyleItem.GetValue(); + } + switch(eXFS) + { + default: + case drawing::FillStyle_NONE: { SelectFillType(*m_xBtnNone, &maSet); - return; + break; } - - // show tab page - drawing::FillStyle eXFS = drawing::FillStyle_NONE; - if (maSet.GetItemState(XATTR_FILLSTYLE) != SfxItemState::DONTCARE) + case drawing::FillStyle_SOLID: { - XFillStyleItem aFillStyleItem(static_cast<const XFillStyleItem&>(maSet.Get(GetWhich( XATTR_FILLSTYLE)))); - eXFS = aFillStyleItem.GetValue(); + SelectFillType(*m_xBtnColor, &maSet); + // color tab page Active and New preview controls are same after SelectFillType + // hack to restore color tab page Active preview + setSvxBrushItemAsFillAttributesToTargetSet(static_cast<const SvxBrushItem&>(m_pResetSet->Get(nWhich)), *m_pResetSet); + static_cast<SvxColorTabPage*>(GetFillTabPage())->SetCtlPreviewOld(*m_pResetSet); + break; } - switch(eXFS) + case drawing::FillStyle_BITMAP: { - default: - case drawing::FillStyle_NONE: - { - SelectFillType(*m_xBtnNone, &maSet); - break; - } - case drawing::FillStyle_SOLID: - { - SelectFillType(*m_xBtnColor, &maSet); - // color tab page Active and New preview controls are same after SelectFillType - // hack to restore color tab page Active preview - setSvxBrushItemAsFillAttributesToTargetSet(static_cast<const SvxBrushItem&>(m_pResetSet->Get(nWhich)), *m_pResetSet); - static_cast<SvxColorTabPage*>(GetFillTabPage())->SetCtlPreviewOld(*m_pResetSet); - break; - } - case drawing::FillStyle_BITMAP: - { - SelectFillType(*m_xBtnBitmap, &maSet); - break; - } + SelectFillType(*m_xBtnBitmap, &maSet); + break; } } } |