summaryrefslogtreecommitdiff
path: root/vcl/source/window/builder.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/builder.cxx')
-rw-r--r--vcl/source/window/builder.cxx7
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)