diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-03-23 15:40:26 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-05-30 11:22:23 +0200 |
commit | 0c11979e2bccd3723a292fe83bef1f10aebde16c (patch) | |
tree | a467e259e05bc51cebd17d75cf0e2bbd3712a53b /sc/source/filter | |
parent | 5606e86fc333ef90e8da08e8cdb34f1256690586 (diff) |
ofz#67540 negative offset
Change-Id: I498985962feb7d77c1a71af7002a85aa02aa3e65
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165232
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index ebccbf860f49..6b154ddbc4fd 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -740,19 +740,22 @@ void ScHTMLLayoutParser::SetWidths() for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i ) { auto& pE = maList[ i ]; - if ( pE->nTab == nTable ) + if (pE->nTab != nTable) + continue; + nCol = pE->nCol - nColCntStart; + OSL_ENSURE( nCol < nColsPerRow, "ScHTMLLayoutParser::SetWidths: column overflow" ); + if (nCol >= nColsPerRow) + continue; + pE->nOffset = pOffsets[nCol]; + nCol = nCol + pE->nColOverlap; + if ( nCol > nColsPerRow ) + nCol = nColsPerRow; + if (nCol < 0) { - nCol = pE->nCol - nColCntStart; - OSL_ENSURE( nCol < nColsPerRow, "ScHTMLLayoutParser::SetWidths: column overflow" ); - if ( nCol < nColsPerRow ) - { - pE->nOffset = pOffsets[nCol]; - nCol = nCol + pE->nColOverlap; - if ( nCol > nColsPerRow ) - nCol = nColsPerRow; - pE->nWidth = pOffsets[nCol] - pE->nOffset; - } + SAL_WARN("sc", "negative offset: " << nCol); + continue; } + pE->nWidth = pOffsets[nCol] - pE->nOffset; } } } |