diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-04-25 11:14:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-04-25 17:29:39 +0200 |
commit | ea7af3d1c589ba72169a1e05ff5800bd77ca861a (patch) | |
tree | c5903620a0c4b892256353297061b932c5769b28 /cui | |
parent | 0b56eb2c10ab4ca027f1a37e04519366b3cd7433 (diff) |
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/border.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/border.cxx | 21 |
2 files changed, 15 insertions, 8 deletions
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()) |