diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 12:12:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-17 20:18:14 +0100 |
commit | dca52ec998946d3e5213190d04cdf98bace50e2c (patch) | |
tree | 19ba6f527d1f4b9b98e3245206134d9b8e4a60b3 /svx/source/dialog/dialcontrol.cxx | |
parent | 357d0010058f57a9ec79f0c7d084eeeb3e1edb14 (diff) |
show degree symbol in DialControl linked spinbuttons
Change-Id: I792755f043109173606a78e947d5dc01f78c6849
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86982
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/dialog/dialcontrol.cxx')
-rw-r--r-- | svx/source/dialog/dialcontrol.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 44bf4cfda288..7faf0d9852e9 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -358,29 +358,29 @@ void DialControl::SetRotation(sal_Int32 nAngle) SetRotation(nAngle, false); } -void DialControl::SetLinkedField(weld::SpinButton* pField, sal_Int32 nDecimalPlaces) +void DialControl::SetLinkedField(weld::MetricSpinButton* pField, sal_Int32 nDecimalPlaces) { mpImpl->mnLinkedFieldValueMultiplyer = 100 / std::pow(10.0, double(nDecimalPlaces)); // remove modify handler from old linked field if( mpImpl->mpLinkField ) { - weld::SpinButton& rField = *mpImpl->mpLinkField; - rField.connect_value_changed(Link<weld::SpinButton&,void>()); + weld::MetricSpinButton& rField = *mpImpl->mpLinkField; + rField.connect_value_changed(Link<weld::MetricSpinButton&,void>()); } // remember the new linked field mpImpl->mpLinkField = pField; // set modify handler at new linked field if( mpImpl->mpLinkField ) { - weld::SpinButton& rField = *mpImpl->mpLinkField; + weld::MetricSpinButton& rField = *mpImpl->mpLinkField; rField.connect_value_changed(LINK(this, DialControl, LinkedFieldModifyHdl)); } } -IMPL_LINK_NOARG(DialControl, LinkedFieldModifyHdl, weld::SpinButton&, void) +IMPL_LINK_NOARG(DialControl, LinkedFieldModifyHdl, weld::MetricSpinButton&, void) { - SetRotation(mpImpl->mpLinkField->get_value() * mpImpl->mnLinkedFieldValueMultiplyer, true); + SetRotation(mpImpl->mpLinkField->get_value(FieldUnit::DEGREE) * mpImpl->mnLinkedFieldValueMultiplyer, true); } void DialControl::SaveValue() @@ -433,7 +433,7 @@ void DialControl::SetRotation(sal_Int32 nAngle, bool bBroadcast) mpImpl->mnAngle = nAngle; InvalidateControl(); if( mpImpl->mpLinkField ) - mpImpl->mpLinkField->set_value(GetRotation() / mpImpl->mnLinkedFieldValueMultiplyer); + mpImpl->mpLinkField->set_value(GetRotation() / mpImpl->mnLinkedFieldValueMultiplyer, FieldUnit::DEGREE); if( bBroadcast ) mpImpl->maModifyHdl.Call(*this); } |