summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-17 12:12:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-17 20:18:14 +0100
commitdca52ec998946d3e5213190d04cdf98bace50e2c (patch)
tree19ba6f527d1f4b9b98e3245206134d9b8e4a60b3 /svx
parent357d0010058f57a9ec79f0c7d084eeeb3e1edb14 (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')
-rw-r--r--svx/source/dialog/dialcontrol.cxx14
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx4
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx2
3 files changed, 10 insertions, 10 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);
}
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 5e3ab55411f0..1e83702d98c6 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -72,7 +72,7 @@ PosSizePropertyPanel::PosSizePropertyPanel(
mxMtrHeight(m_xBuilder->weld_metric_spin_button("selectheight", FieldUnit::CM)),
mxCbxScale(m_xBuilder->weld_check_button("ratio")),
mxFtAngle(m_xBuilder->weld_label("rotationlabel")),
- mxMtrAngle(m_xBuilder->weld_spin_button("rotation")),
+ mxMtrAngle(m_xBuilder->weld_metric_spin_button("rotation", FieldUnit::DEGREE)),
mxCtrlDial(new DialControl),
mxDial(new weld::CustomWeld(*m_xBuilder, "orientationcontrol", *mxCtrlDial)),
mxFtFlip(m_xBuilder->weld_label("fliplabel")),
@@ -669,7 +669,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
long nTmp = pItem->GetValue();
nTmp = nTmp < 0 ? 36000+nTmp : nTmp;
- mxMtrAngle->set_value(nTmp);
+ mxMtrAngle->set_value(nTmp, FieldUnit::DEGREE);
mxCtrlDial->SetRotation(nTmp);
break;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index 8ec9b27a349d..7e5b7b4eea3b 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -90,7 +90,7 @@ private:
//rotation
std::unique_ptr<weld::Label> mxFtAngle;
- std::unique_ptr<weld::SpinButton> mxMtrAngle;
+ std::unique_ptr<weld::MetricSpinButton> mxMtrAngle;
//rotation control
std::unique_ptr<svx::DialControl> mxCtrlDial;