diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-08-14 10:29:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-08-14 15:28:44 +0200 |
commit | 97e49876086bbdcb58ae0c22d9145c453f239468 (patch) | |
tree | 202257093db0b02a1dcfbb22543b65fd4f3217ec /extensions | |
parent | fa575be1e59b333a9aadcf4161686dfae2faa555 (diff) |
tdf#135526 ranges overflowing to become negative
the properties panel uses huge min/maxes which can overflow
when the number of digits changes
Change-Id: Idbb998a065ce8f2b918fceea2076b794cbde3368
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100731
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/propctrlr/standardcontrol.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index 2084a9dae6bf..436f5b412e27 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -331,9 +331,13 @@ namespace pcr return getTypedControlWindow()->get_digits(); } - void SAL_CALL ONumericControl::setDecimalDigits( ::sal_Int16 _decimaldigits ) + void SAL_CALL ONumericControl::setDecimalDigits( ::sal_Int16 decimaldigits ) { - getTypedControlWindow()->set_digits( _decimaldigits ); + weld::MetricSpinButton* pControlWindow = getTypedControlWindow(); + int min, max; + pControlWindow->get_range(min, max, FieldUnit::NONE); + pControlWindow->set_digits(decimaldigits); + pControlWindow->set_range(min, max, FieldUnit::NONE); } Optional< double > SAL_CALL ONumericControl::getMinValue() |