diff options
-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; |