summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-23 21:31:51 +0000
committerMiklos Vajna <vmiklos@collabora.com>2024-04-05 08:56:26 +0200
commit7a0af4a29467f2324ee477bb6d516006174fbbeb (patch)
treeca442ef7ea77612ecc7e81f72f47afa2bafbe116
parente94b113bd4fdd9f6a2604b870b77678e5a3574c8 (diff)
ofz#67563 infinite loop
Change-Id: I1654d23fd8768a77d32fc3150a9d8554afa2e91f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165220 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit b866019e6ee82ce19dacd653861f8d2b701d2a8e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165759 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sc/source/filter/html/htmlpars.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index f00e1f868bb6..cde3c2836c6b 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -725,7 +725,6 @@ sal_uInt16 ScHTMLLayoutParser::GetWidth( const ScEEParseEntry* pE )
void ScHTMLLayoutParser::SetWidths()
{
- SCCOL nCol;
if ( !nTableWidth )
nTableWidth = static_cast<sal_uInt16>(aPageSize.Width());
SCCOL nColsPerRow = nMaxCol - nColCntStart;
@@ -736,7 +735,7 @@ void ScHTMLLayoutParser::SetWidths()
sal_uInt16 nWidth = nTableWidth / static_cast<sal_uInt16>(nColsPerRow);
sal_uInt16 nOff = nColOffsetStart;
pLocalColOffset->clear();
- for ( nCol = 0; nCol <= nColsPerRow; ++nCol, nOff = nOff + nWidth )
+ for (int nCol = 0; nCol <= nColsPerRow; ++nCol, nOff = nOff + nWidth)
{
MakeColNoRef( pLocalColOffset, nOff, 0, 0, 0 );
}
@@ -766,7 +765,7 @@ void ScHTMLLayoutParser::SetWidths()
auto& pE = maList[ i ];
if ( pE->nTab == nTable && pE->nWidth )
{
- nCol = pE->nCol - nColCntStart;
+ SCCOL nCol = pE->nCol - nColCntStart;
if ( nCol < nColsPerRow )
{
if ( pE->nColOverlap == 1 )
@@ -803,7 +802,7 @@ void ScHTMLLayoutParser::SetWidths()
}
sal_uInt16 nWidths = 0;
sal_uInt16 nUnknown = 0;
- for ( nCol = 0; nCol < nColsPerRow; nCol++ )
+ for (SCCOL nCol = 0; nCol < nColsPerRow; nCol++)
{
if ( pWidths[nCol] )
nWidths = nWidths + pWidths[nCol];
@@ -815,18 +814,18 @@ void ScHTMLLayoutParser::SetWidths()
sal_uInt16 nW = ((nWidths < nTableWidth) ?
((nTableWidth - nWidths) / nUnknown) :
(nTableWidth / nUnknown));
- for ( nCol = 0; nCol < nColsPerRow; nCol++ )
+ for (SCCOL nCol = 0; nCol < nColsPerRow; nCol++)
{
if ( !pWidths[nCol] )
pWidths[nCol] = nW;
}
}
- for ( nCol = 1; nCol <= nColsPerRow; nCol++ )
+ for (SCCOL nCol = 1; nCol <= nColsPerRow; nCol++)
{
pOffsets[nCol] = pOffsets[nCol-1] + pWidths[nCol-1];
}
pLocalColOffset->clear();
- for ( nCol = 0; nCol <= nColsPerRow; nCol++ )
+ for (SCCOL nCol = 0; nCol <= nColsPerRow; nCol++)
{
MakeColNoRef( pLocalColOffset, pOffsets[nCol], 0, 0, 0 );
}
@@ -837,7 +836,7 @@ void ScHTMLLayoutParser::SetWidths()
auto& pE = maList[ i ];
if (pE->nTab != nTable)
continue;
- nCol = pE->nCol - nColCntStart;
+ SCCOL nCol = pE->nCol - nColCntStart;
OSL_ENSURE( nCol < nColsPerRow, "ScHTMLLayoutParser::SetWidths: column overflow" );
if (nCol >= nColsPerRow)
continue;