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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/source/window/builder.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index b7e77efb7c17..b0cb0e053fce 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -342,7 +342,12 @@ namespace weld int MetricSpinButton::ConvertValue(int nValue, FieldUnit eInUnit, FieldUnit eOutUnit) const { - return vcl::ConvertValue(nValue, 0, m_xSpinButton->get_digits(), eInUnit, eOutUnit); + auto nRet = vcl::ConvertValue(nValue, 0, m_xSpinButton->get_digits(), eInUnit, eOutUnit); + if (nRet > SAL_MAX_INT32) + nRet = SAL_MAX_INT32; + else if (nRet < SAL_MIN_INT32) + nRet = SAL_MIN_INT32; + return nRet; } IMPL_LINK(MetricSpinButton, spin_button_input, int*, result, bool) |