diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-03 11:53:48 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-10-17 23:22:49 +0200 |
commit | dc536c151161402449fdc1468c1495427813a806 (patch) | |
tree | 626b5421ba45b6904270a83b283b5a27cc2edeac | |
parent | a06be488f4fff3e52c25f60c71997a0dc9268b8c (diff) |
fix crash on loading certain xls
Change-Id: I4f4563b07109df7e2288458cf8adda37582262cf
(cherry picked from commit c4d1a99ec667bdd661669afd72a708bd9a963db2)
Reviewed-on: https://gerrit.libreoffice.org/19110
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
(cherry picked from commit aaf53996e626bdce0c06c5f918e90c9a488eb42b)
-rw-r--r-- | sc/source/filter/excel/impop.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 0c5614faa613..904209d2bb1b 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -1031,17 +1031,21 @@ void ImportExcel::Array34() aIn.Ignore( (GetBiff() >= EXC_BIFF5) ? 6 : 2 ); nFormLen = aIn.ReaduInt16(); + 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); - OSL_ENSURE( pErgebnis, "+ImportExcel::Array34(): ScTokenArray is NULL!" ); + SAL_WARN_IF(!pErgebnis, "sc", "+ImportExcel::Array34(): 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); |