summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-05-26 19:43:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-05-27 17:42:19 +0200
commitd9fa826769cd570814f3556d53493a78d2869873 (patch)
tree8cf5935172f59444900b863bd0926d0363895ed3 /vcl
parentc0851e6306ed1117130d8667e22cfae8d0ee7e53 (diff)
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@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/builder.cxx25
1 files changed, 11 insertions, 14 deletions
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)