summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-04-25 11:14:53 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-04-26 11:40:27 +0200
commit324755caddb21e53454e56889f0d0e6b50923223 (patch)
tree368f38f8e48e061815e770a6fd6d0121c054b878 /cui/source
parentb7662cffb5e12935ffaa4252c081659165600ada (diff)
Resolves: tdf#124804 border considered changed when it isn't
Change-Id: Ib4b6031b31500a8a2086721124b5b8f554f7c1c5 Reviewed-on: https://gerrit.libreoffice.org/71307 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/inc/border.hxx2
-rw-r--r--cui/source/tabpages/border.cxx21
2 files changed, 15 insertions, 8 deletions
diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 009048d738fb..455b88ee5f8c 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 4960f160357f..b81b6830bfd9 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -157,9 +157,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()
@@ -833,16 +842,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())