Kaydet (Commit) fa1b0009 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

don't overflow column number during import, fdo#58539

This should fix the crash with kde#245919

Change-Id: I7c3af01e27233d2f94d5585247c59e7d5b6ea8ca
üst 669c27ca
......@@ -220,6 +220,8 @@ void ScMyTables::AddColStyle(const sal_Int32 nRepeat, const rtl::OUString& rCell
{
rImport.GetStylesImportHelper()->AddColumnStyle(rCellStyleName, nCurrentColCount, nRepeat);
nCurrentColCount += nRepeat;
SAL_WARN_IF(nCurrentColCount > MAXCOL, "sc", "more columns than fit into SCCOL");
nCurrentColCount = std::min<sal_Int32>( nCurrentColCount, MAXCOL );
}
uno::Reference< drawing::XDrawPage > ScMyTables::GetCurrentXDrawPage()
......
......@@ -87,7 +87,7 @@ public:
ScXMLTabProtectionData& GetCurrentProtectionData() { return maProtectionData; }
rtl::OUString GetCurrentSheetName() const { return sCurrentSheetName; }
SCTAB GetCurrentSheet() const { return (maCurrentCellPos.Tab() >= 0) ? maCurrentCellPos.Tab() : 0; }
SCCOL GetCurrentColCount() const { return nCurrentColCount; }
SCCOL GetCurrentColCount() const { return std::min<sal_Int32>(nCurrentColCount, MAXCOL); }
SCROW GetCurrentRow() const { return (maCurrentCellPos.Row() >= 0) ? maCurrentCellPos.Row() : 0; }
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSpreadsheet >
GetCurrentXSheet() const { return xCurrentSheet; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment