diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-02-21 11:25:16 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-25 21:24:02 +0200 |
commit | 3cc59cfae1cf8701ec7a5e7d85fc7a3645f55d96 (patch) | |
tree | bf3f5ba8efe4fcd11f298f1e0851d40526931e51 /cui | |
parent | 9af3a946d23ba4906de7be69f0e1496e84f49390 (diff) |
tdf#115938: Properly detect shadow size control's changed state
This change makes sure that only if the shadow size edit box' text
is changed, it is converted to the size in twips. It sets wrapper's
default value on each SetControlValue, to return proper initial
size when the size text wasn't modified.
Also both ExampleSet and OutSet in SfxTabDialog's Reset handler are
processed to set relevant items back to initial value; otherwise,
as the restored item (marked as unchanged) will be absent in tab's
result set, it would not modify the old items in the two, and they
would keep previous modified values.
Change-Id: Ie4362811968c6e6cbe0f9229bd3c9b29462f5704
Reviewed-on: https://gerrit.libreoffice.org/50196
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit b37a46fdf91dbc66f6ddc1c070aec70716d94a01)
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/tabpages/borderconn.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/cui/source/tabpages/borderconn.cxx b/cui/source/tabpages/borderconn.cxx index 90b6b2f1b41e..7b49f35022f1 100644 --- a/cui/source/tabpages/borderconn.cxx +++ b/cui/source/tabpages/borderconn.cxx @@ -230,7 +230,10 @@ SvxShadowItem ShadowControlsWrapper::GetControlValue() const SvxShadowItem aItem( GetDefaultValue() ); if( !maPosWrp.IsControlDontKnow() ) aItem.SetLocation( maPosWrp.GetControlValue() ); - if( !maSizeWrp.IsControlDontKnow() ) + // Default value was saved; so don't change the aItem's width if the control + // has not changed its value, to avoid round-trip errors (like twip->cm->twip) + // E.g., initial 100 twip will become 0.18 cm, which will return as 102 twip + if( !maSizeWrp.IsControlDontKnow() && maSizeWrp.IsControlValueChanged() ) aItem.SetWidth( maSizeWrp.GetControlValue() ); if( !maColorWrp.IsControlDontKnow() ) aItem.SetColor( maColorWrp.GetControlValue() ); @@ -239,8 +242,10 @@ SvxShadowItem ShadowControlsWrapper::GetControlValue() const void ShadowControlsWrapper::SetControlValue( SvxShadowItem aItem ) { + SetDefaultValue(aItem); maPosWrp.SetControlValue( aItem.GetLocation() ); maSizeWrp.SetControlValue( aItem.GetWidth() ); + maSizeWrp.GetControl().SaveValue(); maColorWrp.SetControlValue( aItem.GetColor() ); } |