summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-04 03:27:01 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-04 03:34:25 +0100
commit94f7417b038fad6f2a92d1c7c5f8f00c3e64711b (patch)
tree1520ae77c47dce595307cdeaf6141d7d9df11781
parent9bcfb6f06bf5a4708b8858469b4118af4222db5a (diff)
don't overflow SCCOL during repeated cell import, fdo#58539
This is the fix for the third and last crash with gnome#627150 Change-Id: Iaf8611500fdb485017814b35789332c6c89530c0
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index f3eca237d1a9..fac119169bd0 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -167,7 +167,8 @@ ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
nMatrixRows = static_cast<SCROW>(sValue.toInt32());
break;
case XML_TOK_TABLE_ROW_CELL_ATTR_REPEATED:
- nColsRepeated = static_cast<SCCOL>(std::max( sValue.toInt32(), static_cast<sal_Int32>(1) ));
+ nColsRepeated = static_cast<SCCOL>(std::min<sal_Int32>( MAXCOLCOUNT,
+ std::max( sValue.toInt32(), static_cast<sal_Int32>(1) ) ));
break;
case XML_TOK_TABLE_ROW_CELL_ATTR_VALUE_TYPE:
nCellType = GetScImport().GetCellType(sValue);