summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-03-29 19:53:17 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2024-04-03 14:38:57 +0200
commitf27b696f46e59c8168bea6c23c6bbb87e8ae64fb (patch)
tree890e1b7e2509cc9e5876acdb867614e7113a7ef8
parentfea111e56804ec761152af31fd083fb79b194cdf (diff)
ofz#67708 ignore oversized colspans
that can't fit in SCCOL ignore negative colspan and rowspans too Change-Id: I79a010bcd7d9d84de70f6dac2e09614d6d448227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165480 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit b2c3ca63d28f7849d33d7a0c6436102fdbf6dbbb)
-rw-r--r--sc/source/filter/html/htmlpars.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 1c230205e89b..063408b18e31 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -939,12 +939,20 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo )
{
case HtmlOptionId::COLSPAN:
{
- mxActEntry->nColOverlap = static_cast<SCCOL>(rOption.GetString().toInt32());
+ sal_Int32 nColOverlap = rOption.GetString().toInt32();
+ if (nColOverlap >= 0 && nColOverlap <= SCCOL_MAX)
+ mxActEntry->nColOverlap = static_cast<SCCOL>(nColOverlap);
+ else
+ SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring colspan: " << nColOverlap);
}
break;
case HtmlOptionId::ROWSPAN:
{
- mxActEntry->nRowOverlap = static_cast<SCROW>(rOption.GetString().toInt32());
+ sal_Int32 nRowOverlap = rOption.GetString().toInt32();
+ if (nRowOverlap >= 0)
+ mxActEntry->nRowOverlap = static_cast<SCROW>(nRowOverlap);
+ else
+ SAL_WARN("sc", "ScHTMLLayoutParser::TableDataOn ignoring rowspan: " << nRowOverlap);
}
break;
case HtmlOptionId::ALIGN: