diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-01 21:40:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-02 10:09:29 +0200 |
commit | ed67b443d1db273818737ef7996330a8f475361b (patch) | |
tree | a8d995e38c7064a68f4841994eb0e0e887678c27 /vcl/source/window | |
parent | f420aa3e027e04e49b7031ebf0613debcaab2ea0 (diff) |
clamp to target type bounds
Change-Id: I8d3f7653b7e9b64a2f433b4ebfb8a0fef1522e93
Reviewed-on: https://gerrit.libreoffice.org/71637
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/builder.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9cda9210b38d..4006ace7bc36 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -284,7 +284,13 @@ namespace weld double fResult(0.0); bool bRet = MetricFormatter::TextToValue(get_text(), fResult, 0, m_xSpinButton->get_digits(), rLocaleData, m_eSrcUnit); if (bRet) + { + if (fResult > SAL_MAX_INT32) + fResult = SAL_MAX_INT32; + else if (fResult < SAL_MIN_INT32) + fResult = SAL_MIN_INT32; *result = fResult; + } return bRet; } |