[Libreoffice-commits] core.git: chart2/source cui/source include/svx sc/qa svx/source sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 17 19:18:49 UTC 2020


 chart2/source/controller/dialogs/res_DataLabel.cxx    |    2 +-
 chart2/source/controller/dialogs/res_DataLabel.hxx    |    2 +-
 chart2/source/controller/dialogs/tp_AxisLabel.cxx     |    2 +-
 chart2/source/controller/dialogs/tp_AxisLabel.hxx     |    2 +-
 chart2/source/controller/dialogs/tp_PolarOptions.cxx  |    2 +-
 chart2/source/controller/dialogs/tp_PolarOptions.hxx  |    2 +-
 chart2/source/controller/dialogs/tp_TitleRotation.cxx |    2 +-
 chart2/source/controller/dialogs/tp_TitleRotation.hxx |    2 +-
 cui/source/inc/align.hxx                              |    2 +-
 cui/source/inc/transfrm.hxx                           |    2 +-
 cui/source/tabpages/align.cxx                         |    2 +-
 cui/source/tabpages/transfrm.cxx                      |    2 +-
 include/svx/dialcontrol.hxx                           |    6 +++---
 sc/qa/uitest/chart/chartDataLabels.py                 |    2 +-
 svx/source/dialog/dialcontrol.cxx                     |   14 +++++++-------
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx   |    4 ++--
 svx/source/sidebar/possize/PosSizePropertyPanel.hxx   |    2 +-
 sw/source/ui/frmdlg/frmpage.cxx                       |    2 +-
 sw/source/uibase/inc/frmpage.hxx                      |    2 +-
 19 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit dca52ec998946d3e5213190d04cdf98bace50e2c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jan 17 12:12:44 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jan 17 20:18:14 2020 +0100

    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 at redhat.com>

diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 2889bdb74f13..69ed9f478746 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -106,7 +106,7 @@ DataLabelResources::DataLabelResources(weld::Builder* pBuilder, weld::Window* pP
     , m_xLB_LabelPlacement(pBuilder->weld_combo_box("LB_LABEL_PLACEMENT"))
     , m_xBxOrientation(pBuilder->weld_widget("boxORIENTATION"))
     , m_xFT_Dial(pBuilder->weld_label("CT_LABEL_DIAL"))
-    , m_xNF_Degrees(pBuilder->weld_spin_button("NF_LABEL_DEGREES"))
+    , m_xNF_Degrees(pBuilder->weld_metric_spin_button("NF_LABEL_DEGREES", FieldUnit::DEGREE))
     , m_xBxTextDirection(pBuilder->weld_widget("boxTXT_DIRECTION"))
     , m_xLB_TextDirection(new TextDirectionListBox(pBuilder->weld_combo_box("LB_LABEL_TEXTDIR")))
     , m_xDC_Dial(new weld::CustomWeld(*pBuilder, "CT_DIAL", m_aDC_Dial))
diff --git a/chart2/source/controller/dialogs/res_DataLabel.hxx b/chart2/source/controller/dialogs/res_DataLabel.hxx
index 617056298b42..42f5a9f24e4e 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.hxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.hxx
@@ -78,7 +78,7 @@ private:
 
     std::unique_ptr<weld::Widget> m_xBxOrientation;
     std::unique_ptr<weld::Label> m_xFT_Dial;
-    std::unique_ptr<weld::SpinButton> m_xNF_Degrees;
+    std::unique_ptr<weld::MetricSpinButton> m_xNF_Degrees;
 
     std::unique_ptr<weld::Widget> m_xBxTextDirection;
 
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
index dfc6bf887878..82617b346fd2 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx
@@ -50,7 +50,7 @@ SchAxisLabelTabPage::SchAxisLabelTabPage(weld::Container* pPage, weld::DialogCon
     , m_xFtABCD(m_xBuilder->weld_label("labelABCD"))
     , m_xFlOrient(m_xBuilder->weld_label("labelTextOrient"))
     , m_xFtRotate(m_xBuilder->weld_label("degreeL"))
-    , m_xNfRotate(m_xBuilder->weld_spin_button("OrientDegree"))
+    , m_xNfRotate(m_xBuilder->weld_metric_spin_button("OrientDegree", FieldUnit::DEGREE))
     , m_xCbStacked(m_xBuilder->weld_check_button("stackedCB"))
     , m_xFtTextDirection(m_xBuilder->weld_label("textdirL"))
     , m_xLbTextDirection(new TextDirectionListBox(m_xBuilder->weld_combo_box("textdirLB")))
diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.hxx b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
index ae048cf53079..d654d7df6e40 100644
--- a/chart2/source/controller/dialogs/tp_AxisLabel.hxx
+++ b/chart2/source/controller/dialogs/tp_AxisLabel.hxx
@@ -59,7 +59,7 @@ private:
     std::unique_ptr<weld::Label> m_xFtABCD;
     std::unique_ptr<weld::Label> m_xFlOrient;
     std::unique_ptr<weld::Label> m_xFtRotate;
-    std::unique_ptr<weld::SpinButton> m_xNfRotate;
+    std::unique_ptr<weld::MetricSpinButton> m_xNfRotate;
     std::unique_ptr<weld::CheckButton> m_xCbStacked;
     std::unique_ptr<weld::Label> m_xFtTextDirection;
     std::unique_ptr<TextDirectionListBox> m_xLbTextDirection;
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index 74f8d12d14a5..c4da9b16f2aa 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -30,7 +30,7 @@ PolarOptionsTabPage::PolarOptionsTabPage(weld::Container* pPage, weld::DialogCon
     : SfxTabPage(pPage, pController, "modules/schart/ui/tp_PolarOptions.ui", "tp_PolarOptions", &rInAttrs)
     , m_xCB_Clockwise(m_xBuilder->weld_check_button("CB_CLOCKWISE"))
     , m_xFL_StartingAngle(m_xBuilder->weld_frame("frameANGLE"))
-    , m_xNF_StartingAngle(m_xBuilder->weld_spin_button("NF_STARTING_ANGLE"))
+    , m_xNF_StartingAngle(m_xBuilder->weld_metric_spin_button("NF_STARTING_ANGLE", FieldUnit::DEGREE))
     , m_xFL_PlotOptions(m_xBuilder->weld_frame("framePLOT_OPTIONS"))
     , m_xCB_IncludeHiddenCells(m_xBuilder->weld_check_button("CB_INCLUDE_HIDDEN_CELLS_POLAR"))
     , m_xAngleDial(new weld::CustomWeld(*m_xBuilder, "CT_ANGLE_DIAL", m_aAngleDial))
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index 55b26d3e56d1..65911dc4eb52 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -47,7 +47,7 @@ private:
     svx::DialControl m_aAngleDial;
     std::unique_ptr<weld::CheckButton> m_xCB_Clockwise;
     std::unique_ptr<weld::Frame> m_xFL_StartingAngle;
-    std::unique_ptr<weld::SpinButton> m_xNF_StartingAngle;
+    std::unique_ptr<weld::MetricSpinButton> m_xNF_StartingAngle;
     std::unique_ptr<weld::Frame> m_xFL_PlotOptions;
     std::unique_ptr<weld::CheckButton> m_xCB_IncludeHiddenCells;
     std::unique_ptr<weld::CustomWeld> m_xAngleDial;
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
index 1cd5ecdf6558..e5754ef3e94e 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx
@@ -33,7 +33,7 @@ SchAlignmentTabPage::SchAlignmentTabPage(weld::Container* pPage, weld::DialogCon
                                          const SfxItemSet& rInAttrs, bool bWithRotation)
     : SfxTabPage(pPage, pController, "modules/schart/ui/titlerotationtabpage.ui", "TitleRotationTabPage", &rInAttrs)
     , m_xFtRotate(m_xBuilder->weld_label("degreeL"))
-    , m_xNfRotate(m_xBuilder->weld_spin_button("OrientDegree"))
+    , m_xNfRotate(m_xBuilder->weld_metric_spin_button("OrientDegree", FieldUnit::DEGREE))
     , m_xCbStacked(m_xBuilder->weld_check_button("stackedCB"))
     , m_xFtTextDirection(m_xBuilder->weld_label("textdirL"))
     , m_xFtABCD(m_xBuilder->weld_label("labelABCD"))
diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.hxx b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
index b84c4720f173..cb2258c27d99 100644
--- a/chart2/source/controller/dialogs/tp_TitleRotation.hxx
+++ b/chart2/source/controller/dialogs/tp_TitleRotation.hxx
@@ -39,7 +39,7 @@ class SchAlignmentTabPage : public SfxTabPage
 private:
     svx::DialControl m_aCtrlDial;
     std::unique_ptr<weld::Label> m_xFtRotate;
-    std::unique_ptr<weld::SpinButton> m_xNfRotate;
+    std::unique_ptr<weld::MetricSpinButton> m_xNfRotate;
     std::unique_ptr<weld::CheckButton> m_xCbStacked;
     std::unique_ptr<weld::Label> m_xFtTextDirection;
     std::unique_ptr<weld::Label> m_xFtABCD;
diff --git a/cui/source/inc/align.hxx b/cui/source/inc/align.hxx
index 03af4f943db9..ebfdd984d3b2 100644
--- a/cui/source/inc/align.hxx
+++ b/cui/source/inc/align.hxx
@@ -89,7 +89,7 @@ private:
     std::unique_ptr<weld::ComboBox> m_xLbVerAlign;
 
     std::unique_ptr<weld::Label> m_xFtRotate;
-    std::unique_ptr<weld::SpinButton> m_xNfRotate;
+    std::unique_ptr<weld::MetricSpinButton> m_xNfRotate;
     std::unique_ptr<weld::Label> m_xFtRefEdge;
     std::unique_ptr<weld::CheckButton> m_xCbStacked;
     std::unique_ptr<weld::CheckButton> m_xCbAsianMode;
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index c83f0bf60030..3c5506ef3c4e 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -182,7 +182,7 @@ private:
     std::unique_ptr<weld::MetricSpinButton> m_xMtrPosY;
     std::unique_ptr<weld::CustomWeld> m_xCtlRect;
     std::unique_ptr<weld::Widget> m_xFlAngle;
-    std::unique_ptr<weld::SpinButton> m_xNfAngle;
+    std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
     std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
 
 public:
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 33cce4de3795..9c0886097fe1 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -112,7 +112,7 @@ AlignmentTabPage::AlignmentTabPage(weld::Container* pPage, weld::DialogControlle
     , m_xLbVerAlign(m_xBuilder->weld_combo_box("comboboxVertAlign"))
     //text rotation
     , m_xFtRotate(m_xBuilder->weld_label("labelDegrees"))
-    , m_xNfRotate(m_xBuilder->weld_spin_button("spinDegrees"))
+    , m_xNfRotate(m_xBuilder->weld_metric_spin_button("spinDegrees", FieldUnit::DEGREE))
     , m_xFtRefEdge(m_xBuilder->weld_label("labelRefEdge"))
     //Asian mode
     , m_xCbStacked(m_xBuilder->weld_check_button("checkVertStack"))
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 5dc45a108ff8..aad88fb32555 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -176,7 +176,7 @@ SvxAngleTabPage::SvxAngleTabPage(weld::Container* pPage, weld::DialogController*
     , m_xMtrPosY(m_xBuilder->weld_metric_spin_button("MTR_FLD_POS_Y", FieldUnit::CM))
     , m_xCtlRect(new weld::CustomWeld(*m_xBuilder, "CTL_RECT", m_aCtlRect))
     , m_xFlAngle(m_xBuilder->weld_widget("FL_ANGLE"))
-    , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE"))
+    , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
     , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
 {
     // calculate PoolUnit
diff --git a/include/svx/dialcontrol.hxx b/include/svx/dialcontrol.hxx
index 1b768e2c9ec5..70d1071f2ba3 100644
--- a/include/svx/dialcontrol.hxx
+++ b/include/svx/dialcontrol.hxx
@@ -104,7 +104,7 @@ public:
      *     default is 0 which means field values are in degrees,
      *     2 means 100th of degree
      */
-    void                SetLinkedField(weld::SpinButton* pField, sal_Int32 nDecimalPlaces = 0);
+    void                SetLinkedField(weld::MetricSpinButton* pField, sal_Int32 nDecimalPlaces = 0);
 
     /** Save value for later comparison */
     void                SaveValue();
@@ -126,7 +126,7 @@ private:
         ScopedVclPtr<DialControlBmp> mxBmpBuffered;
         Link<DialControl&,void>      maModifyHdl;
         OUString            maText;
-        weld::SpinButton*   mpLinkField;
+        weld::MetricSpinButton*   mpLinkField;
         sal_Int32           mnLinkedFieldValueMultiplyer;
         Size                maWinSize;
         vcl::Font           maWinFont;
@@ -152,7 +152,7 @@ private:
 
     void                InvalidateControl();
 
-    DECL_LINK(LinkedFieldModifyHdl, weld::SpinButton&, void);
+    DECL_LINK(LinkedFieldModifyHdl, weld::MetricSpinButton&, void);
 };
 
 }
diff --git a/sc/qa/uitest/chart/chartDataLabels.py b/sc/qa/uitest/chart/chartDataLabels.py
index d1d1cf367a18..7747875c3329 100644
--- a/sc/qa/uitest/chart/chartDataLabels.py
+++ b/sc/qa/uitest/chart/chartDataLabels.py
@@ -93,7 +93,7 @@ class chartDataLabels(UITestCase):
     self.assertEqual(get_state_as_dict(wrapText)["Selected"], "true")
     self.assertEqual(get_state_as_dict(separator)["SelectEntryText"], "Comma")
     self.assertEqual(get_state_as_dict(placement)["SelectEntryText"], "Below")
-    self.assertEqual(get_state_as_dict(degrees)["Text"], "1")
+    self.assertEqual(get_state_as_dict(degrees)["Text"], "1°")
     self.assertEqual(get_state_as_dict(textDirection)["SelectEntryText"], "Right-to-left")
 
     xOKBtn = xDialog.getChild("ok")
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;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index d99562c06266..7bb7c04b752d 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2315,7 +2315,7 @@ SwGrfExtPage::SwGrfExtPage(weld::Container* pPage, weld::DialogController* pCont
     , m_xLinkFrame(m_xBuilder->weld_frame("linkframe"))
     // RotGrfFlyFrame: Need Angle and RotateControls now
     , m_xFlAngle(m_xBuilder->weld_frame("FL_ANGLE"))
-    , m_xNfAngle(m_xBuilder->weld_spin_button("NF_ANGLE"))
+    , m_xNfAngle(m_xBuilder->weld_metric_spin_button("NF_ANGLE", FieldUnit::DEGREE))
     , m_xCtlAngle(new weld::CustomWeld(*m_xBuilder, "CTL_ANGLE", m_aCtlAngle))
     , m_xBmpWin(new weld::CustomWeld(*m_xBuilder, "preview", m_aBmpWin))
 {
diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx
index 1906a01d90a9..a5c57aa9a1b4 100644
--- a/sw/source/uibase/inc/frmpage.hxx
+++ b/sw/source/uibase/inc/frmpage.hxx
@@ -217,7 +217,7 @@ class SwGrfExtPage : public SfxTabPage
 
     // RotGrfFlyFrame: Need Angle and RotateControls now
     std::unique_ptr<weld::Frame> m_xFlAngle;
-    std::unique_ptr<weld::SpinButton> m_xNfAngle;
+    std::unique_ptr<weld::MetricSpinButton> m_xNfAngle;
     std::unique_ptr<weld::CustomWeld> m_xCtlAngle;
     std::unique_ptr<weld::CustomWeld> m_xBmpWin;
 


More information about the Libreoffice-commits mailing list