diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-22 18:49:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-23 10:18:31 +0100 |
commit | ea20bc176cbf575e39c602a91dd3e6919b3fc31e (patch) | |
tree | dab04f713233ba4126e7a4c23d265003349c9919 /sc/source | |
parent | 8d37253e50aca502a1f80ef648deb6f5178c4c46 (diff) |
USHRT_MAX -> SAL_MAX_UINT16
...that had presumably been forgotten when the surrounding code had been changed
from USHORT to sal_uInt16 in cd42389ad67b403a07a0dda8e2a6e213def49251
"removetooltypes01: #i112600# remove tooltypes from sc". Plus, turning the
preprocessor checks into static_asserts.
Change-Id: I78271f7027af701699865913813d6dea8b0c570b
Reviewed-on: https://gerrit.libreoffice.org/48358
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index bedeaa75c7c9..f08c09ce69eb 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -284,10 +284,8 @@ bool ScInterpreter::CreateDoubleArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, { // Old Add-Ins are hard limited to sal_uInt16 values. -#if MAXCOLCOUNT_DEFINE > USHRT_MAX -#error Add check for columns > USHRT_MAX! -#endif - if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) + static_assert(MAXCOLCOUNT <= SAL_MAX_UINT16, "Add check for columns > SAL_MAX_UINT16!"); + if (nRow1 > SAL_MAX_UINT16 || nRow2 > SAL_MAX_UINT16) return false; sal_uInt16 nCount = 0; @@ -369,10 +367,8 @@ bool ScInterpreter::CreateStringArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, { // Old Add-Ins are hard limited to sal_uInt16 values. -#if MAXCOLCOUNT_DEFINE > USHRT_MAX -#error Add check for columns > USHRT_MAX! -#endif - if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) + static_assert(MAXCOLCOUNT <= SAL_MAX_UINT16, "Add check for columns > SAL_MAX_UINT16!"); + if (nRow1 > SAL_MAX_UINT16 || nRow2 > SAL_MAX_UINT16) return false; sal_uInt16 nCount = 0; @@ -468,10 +464,8 @@ bool ScInterpreter::CreateCellArr(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, { // Old Add-Ins are hard limited to sal_uInt16 values. -#if MAXCOLCOUNT_DEFINE > USHRT_MAX -#error Add check for columns > USHRT_MAX! -#endif - if (nRow1 > USHRT_MAX || nRow2 > USHRT_MAX) + static_assert(MAXCOLCOUNT <= SAL_MAX_UINT16, "Add check for columns > SAL_MAX_UINT16!"); + if (nRow1 > SAL_MAX_UINT16 || nRow2 > SAL_MAX_UINT16) return false; sal_uInt16 nCount = 0; |