Kaydet (Commit) 280cc198 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
bf4154eb "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/48348Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 859b91cb
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment