Kaydet (Commit) 4f30849f authored tarafından Eike Rathke's avatar Eike Rathke

don't loop uint16 against size

Theoretically selecting over 64k rows with a series sequence and calling Fill
could had looped endless.

Change-Id: I1740b674638eb90d51808e619c562cf8064f4888
üst c3043a30
......@@ -294,7 +294,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
bool bVal = true;
for (sal_uInt16 i=1; i<nCount && bVal; i++)
for (SCSIZE i=1; i<nCount && bVal; i++)
{
ScRefCellValue aCell = GetCellValue(nCol,nRow);
if (aCell.meType == CELLTYPE_VALUE)
......@@ -351,7 +351,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
bool bVal = true;
for (sal_uInt16 i=1; i<nCount && bVal; i++)
for (SCSIZE i=1; i<nCount && bVal; i++)
{
ScRefCellValue aCell = GetCellValue(nCol,nRow);
if (aCell.meType == CELLTYPE_VALUE)
......@@ -399,7 +399,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
(void)rListData->GetSubIndex(aStr, rListIndex, bMatchCase);
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
for (sal_uInt16 i=1; i<nCount && rListData; i++)
for (SCSIZE i=1; i<nCount && rListData; i++)
{
(void)GetString(nCol, nRow, aStr);
if (!rListData->GetSubIndex(aStr, rListIndex, bMatchCase))
......@@ -426,7 +426,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
bool bVal = true;
for (sal_uInt16 i=1; i<nCount && bVal; i++)
for (SCSIZE i=1; i<nCount && bVal; i++)
{
ScRefCellValue aCell = GetCellValue(nCol, nRow);
CellType eType = aCell.meType;
......
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