summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-23 21:31:51 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2024-04-04 11:22:43 +0200
commitb772466960bbdf4785ff071dea05e834df732f52 (patch)
treede301098e16e1b139c1e6aa620c2977bfecc1995
parentae8ee986617832ae7ffd853279d6b898386a51dd (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/+/165715 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-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 82aef16fed9a..2130e1119fa0 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -718,7 +718,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;
@@ -729,7 +728,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 );
}
@@ -759,7 +758,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 )
@@ -796,7 +795,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];
@@ -808,18 +807,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 );
}
@@ -830,7 +829,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;