[Libreoffice-commits] core.git: vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 27 15:42:58 UTC 2020


 vcl/source/window/builder.cxx |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

New commits:
commit d9fa826769cd570814f3556d53493a78d2869873
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 26 19:43:12 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 27 17:42:19 2020 +0200

    tdf#133396 FormattedField comes with differrent defaults than GtkSpinButton
    
    so explicitly set the GtkSpinButton defaults in their absence from a GtkAdjustment
    
    Change-Id: Idbf3370ab35c9d48a4f01a680ca4413238a8fd6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94887
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a763b3035c03..11b67010356c 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -4379,32 +4379,29 @@ void VclBuilder::mungeAdjustment(NumericFormatter &rTarget, const Adjustment &rA
 
 void VclBuilder::mungeAdjustment(FormattedField &rTarget, const Adjustment &rAdjustment)
 {
+    double nMaxValue = 0, nMinValue = 0, nValue = 0, nSpinSize = 0;
+
     for (auto const& elem : rAdjustment)
     {
         const OString &rKey = elem.first;
         const OUString &rValue = elem.second;
 
         if (rKey == "upper")
-        {
-            rTarget.SetMaxValue(rValue.toDouble());
-        }
+            nMaxValue = rValue.toDouble();
         else if (rKey == "lower")
-        {
-            rTarget.SetMinValue(rValue.toDouble());
-        }
+            nMinValue = rValue.toDouble();
         else if (rKey == "value")
-        {
-            rTarget.SetValue(rValue.toDouble());
-        }
+            nValue = rValue.toDouble();
         else if (rKey == "step-increment")
-        {
-            rTarget.SetSpinSize(rValue.toDouble());
-        }
+            nSpinSize = rValue.toDouble();
         else
-        {
             SAL_INFO("vcl.builder", "unhandled property :" << rKey);
-        }
     }
+
+    rTarget.SetMinValue(nMinValue);
+    rTarget.SetMaxValue(nMaxValue);
+    rTarget.SetValue(nValue);
+    rTarget.SetSpinSize(nSpinSize);
 }
 
 void VclBuilder::mungeAdjustment(TimeField &rTarget, const Adjustment &rAdjustment)


More information about the Libreoffice-commits mailing list