diff options
-rw-r--r-- | sc/qa/unit/data/xls/pass/crash-1.xls | bin | 4096 -> 183 bytes | |||
-rw-r--r-- | sc/source/filter/excel/impop.cxx | 24 |
2 files changed, 13 insertions, 11 deletions
diff --git a/sc/qa/unit/data/xls/pass/crash-1.xls b/sc/qa/unit/data/xls/pass/crash-1.xls Binary files differindex 724bfc1a6f14..4b801ea3933b 100644 --- a/sc/qa/unit/data/xls/pass/crash-1.xls +++ b/sc/qa/unit/data/xls/pass/crash-1.xls diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index a08bd1468b3f..4339ae40bca0 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -520,13 +520,11 @@ void ImportExcel::Columndefault() void ImportExcel::Array25() { - sal_uInt16 nFirstRow, nLastRow, nFormLen; - sal_uInt8 nFirstCol, nLastCol; - - nFirstRow = aIn.ReaduInt16(); - nLastRow = aIn.ReaduInt16(); - nFirstCol = aIn.ReaduInt8(); - nLastCol = aIn.ReaduInt8(); + sal_uInt16 nFormLen; + sal_uInt16 nFirstRow = aIn.ReaduInt16(); + sal_uInt16 nLastRow = aIn.ReaduInt16(); + sal_uInt8 nFirstCol = aIn.ReaduInt8(); + sal_uInt8 nLastCol = aIn.ReaduInt8(); if( GetBiff() == EXC_BIFF2 ) {// BIFF2 @@ -539,17 +537,21 @@ void ImportExcel::Array25() nFormLen = aIn.ReaduInt16(); } - if( ValidColRow( nLastCol, nLastRow ) ) + const ScTokenArray* pErgebnis = nullptr; + + if (ValidColRow(nLastCol, nLastRow)) { // the read mark is now on the formula, length in nFormLen - const ScTokenArray* pErgebnis; pFormConv->Reset( ScAddress( static_cast<SCCOL>(nFirstCol), static_cast<SCROW>(nFirstRow), GetCurrScTab() ) ); - pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); + pFormConv->Convert(pErgebnis, maStrm, nFormLen, true, FT_CellFormula); - OSL_ENSURE( pErgebnis, "*ImportExcel::Array25(): ScTokenArray is NULL!" ); + SAL_WARN_IF(!pErgebnis, "sc", "*ImportExcel::Array25(): ScTokenArray is NULL!"); + } + if (pErgebnis) + { ScDocumentImport& rDoc = GetDocImport(); ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab()); rDoc.setMatrixCells(aArrayRange, *pErgebnis, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1); |