sc/source/filter/html/htmlpars.cxx |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 7a0af4a29467f2324ee477bb6d516006174fbbeb
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Mar 23 21:31:51 2024 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Apr 5 08:56:26 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/+/165759
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

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;

Reply via email to