cui/source/inc/border.hxx | 2 ++ cui/source/tabpages/border.cxx | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-)
New commits: commit ea7af3d1c589ba72169a1e05ff5800bd77ca861a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Apr 25 11:14:53 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Apr 25 17:29:39 2019 +0200 Resolves: tdf#124804 border considered changed when it isn't Change-Id: Ib4b6031b31500a8a2086721124b5b8f554f7c1c5 Reviewed-on: https://gerrit.libreoffice.org/71296 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx index a57db4dc58f0..733538499ec0 100644 --- a/cui/source/inc/border.hxx +++ b/cui/source/inc/border.hxx @@ -49,6 +49,8 @@ public: void SetControlValue(const SvxShadowItem& rItem); void SetControlDontKnow(); + bool get_value_changed_from_saved() const; + private: SvtValueSet& mrVsPos; weld::MetricSpinButton& mrMfSize; diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx index d9cd2e4a2c2c..f024fa707deb 100644 --- a/cui/source/tabpages/border.cxx +++ b/cui/source/tabpages/border.cxx @@ -159,9 +159,18 @@ void ShadowControlsWrapper::SetControlValue(const SvxShadowItem& rItem) mrVsPos.SetNoSelection(); break; } + mrVsPos.SaveValue(); mrMfSize.set_value(mrMfSize.normalize(rItem.GetWidth()), FieldUnit::TWIP); - mrLbColor.SelectEntry(rItem.GetColor()); mrMfSize.save_value(); + mrLbColor.SelectEntry(rItem.GetColor()); + mrLbColor.SaveValue(); +} + +bool ShadowControlsWrapper::get_value_changed_from_saved() const +{ + return mrVsPos.IsValueChangedFromSaved() || + mrMfSize.get_value_changed_from_saved() || + mrLbColor.IsValueChangedFromSaved(); } void ShadowControlsWrapper::SetControlDontKnow() @@ -863,16 +872,12 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) bAttrsChanged = true; } - if (m_xShadowControls) + if (m_xShadowControls && m_xShadowControls->get_value_changed_from_saved()) { sal_uInt16 nShadowId = pPool->GetWhich(mnShadowSlot); const SvxShadowItem& rOldShadowItem = *static_cast<const SvxShadowItem*>(rCoreAttrs->GetItem(nShadowId)); - SvxShadowItem aNewShadowItem = m_xShadowControls->GetControlValue(rOldShadowItem); - if (aNewShadowItem != rOldShadowItem) - { - rCoreAttrs->Put(aNewShadowItem); - bAttrsChanged = true; - } + rCoreAttrs->Put(m_xShadowControls->GetControlValue(rOldShadowItem)); + bAttrsChanged = true; } if (m_xMarginControls && m_xMarginControls->get_value_changed_from_saved()) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits