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

USHRT_MAX -> SAL_MAX_UINT16

...that had presumably been forgotten when the surrounding code had been changed
from USHORT to sal_uInt16 in cd42389a
"removetooltypes01: #i112600# remove tooltypes from sc".  Plus, turning the
preprocessor checks into static_asserts.

Change-Id: I78271f7027af701699865913813d6dea8b0c570b
Reviewed-on: https://gerrit.libreoffice.org/48358Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 8d37253e
......@@ -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;
......
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