sc/source/filter/html/htmlpars.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
New commits: commit 4159c05e573e8d8a4e70a74d337662a5e32b93ee Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Mar 23 21:31:51 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Fri Apr 5 11:03:44 2024 +0200 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.mcnam...@collabora.com> (cherry picked from commit b866019e6ee82ce19dacd653861f8d2b701d2a8e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165716 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 80277ae6b71b..2dd1de2c5693 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -721,7 +721,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; @@ -732,7 +731,7 @@ void ScHTMLLayoutParser::SetWidths() sal_uInt16 nWidth = nTableWidth / static_cast<sal_uInt16>(nColsPerRow); sal_uInt16 nOff = nColOffsetStart; xLocalColOffset->clear(); - for ( nCol = 0; nCol <= nColsPerRow; ++nCol, nOff = nOff + nWidth ) + for (int nCol = 0; nCol <= nColsPerRow; ++nCol, nOff = nOff + nWidth) { MakeColNoRef( xLocalColOffset.get(), nOff, 0, 0, 0 ); } @@ -762,7 +761,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 ) @@ -799,7 +798,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]; @@ -811,18 +810,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]; } xLocalColOffset->clear(); - for ( nCol = 0; nCol <= nColsPerRow; nCol++ ) + for (SCCOL nCol = 0; nCol <= nColsPerRow; nCol++) { MakeColNoRef( xLocalColOffset.get(), pOffsets[nCol], 0, 0, 0 ); } @@ -833,7 +832,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;