diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-22 16:09:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-23 07:56:35 +0100 |
commit | 280cc198296b6728d990ee40f92b7f842c4959b1 (patch) | |
tree | c45337a33317791d9306a5c1ea5a8349fc2e633f /forms | |
parent | 859b91cb8ad29ff416e10da85ad493d05b10b83d (diff) |
Fix odd check for nFieldLen range, assuming typos
The code used the odd combination of checking signed nFieldLen for != 0 and
<= USHRT_MAX, and then converting to sal_Int16 (not sal_uInt16) ever since
bf4154eb5307ec8c35f000fd1df39ef3abb2eb6d "initial import". But there are indeed
various MaxTextLen properties in offapi of type short, not unsigned short, so
for one assume that checking for <= SAL_MAX_INT16 (not SAL_MAX_UINT16) was
actually intended. And, for another, also assume that checking nFieldLen for
> 0 instead of != 0 was intended.
Change-Id: I119ef3ce71ee397cb6cbca714bca154e29e6599d
Reviewed-on: https://gerrit.libreoffice.org/48348
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Edit.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx index 5c845a01866e..0454af30f4ba 100644 --- a/forms/source/component/Edit.cxx +++ b/forms/source/component/Edit.cxx @@ -576,7 +576,7 @@ void OEditModel::onConnectedDbColumn( const Reference< XInterface >& _rxForm ) sal_Int32 nFieldLen = 0; xField->getPropertyValue("Precision") >>= nFieldLen; - if (nFieldLen && nFieldLen <= USHRT_MAX) + if (nFieldLen > 0 && nFieldLen <= SAL_MAX_INT16) { Any aVal; aVal <<= static_cast<sal_Int16>(nFieldLen); |