diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-25 22:52:56 +0200 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-09-25 22:54:06 +0200 |
commit | 1bde610add5ff77043a58110d6bc5830990d99d5 (patch) | |
tree | 49f0ff2a76c52d266852dcfdb4e4995d14a4951c /sc/source | |
parent | 5342cd7533a51fd488de85565674ee01649ddcbc (diff) |
Use ScDocumentImport to set matrix formula cells from xls.
Change-Id: I3462dffea93c151ccf85eb51cda9511757b72fb2
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/documentimport.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/impop.cxx | 18 |
2 files changed, 10 insertions, 12 deletions
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index d3dd4dbcb97b..9998e83cc97d 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -243,6 +243,10 @@ void ScDocumentImport::setMatrixCells( pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, rBasePos.Row(), pCell); + // Matrix formulas currently need re-calculation on import. + pCell->SetMatColsRows( + rRange.aEnd.Col()-rRange.aStart.Col()+1, rRange.aEnd.Row()-rRange.aStart.Row()+1, true); + // Set the reference cells. ScSingleRefData aRefData; aRefData.InitFlags(); diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 4239a5e8e39f..b855bc25fc8e 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -560,12 +560,9 @@ void ImportExcel::Array25( void ) OSL_ENSURE( pErgebnis, "*ImportExcel::Array25(): ScTokenArray is NULL!" ); - ScMarkData aMarkData; - aMarkData.SelectOneTable( GetCurrScTab() ); - pD->InsertMatrixFormula( static_cast<SCCOL>(nFirstCol), - static_cast<SCROW>(nFirstRow), static_cast<SCCOL>(nLastCol), - static_cast<SCROW>(nLastRow), aMarkData, EMPTY_STRING, - pErgebnis ); + ScDocumentImport& rDoc = GetDocImport(); + ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab()); + rDoc.setMatrixCells(aArrayRange, *pErgebnis, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1); } } @@ -1072,12 +1069,9 @@ void ImportExcel::Array34( void ) OSL_ENSURE( pErgebnis, "+ImportExcel::Array34(): ScTokenArray is NULL!" ); - ScMarkData aMarkData; - aMarkData.SelectOneTable( GetCurrScTab() ); - pD->InsertMatrixFormula( static_cast<SCCOL>(nFirstCol), - static_cast<SCROW>(nFirstRow), static_cast<SCCOL>(nLastCol), - static_cast<SCROW>(nLastRow), aMarkData, EMPTY_STRING, - pErgebnis); + ScDocumentImport& rDoc = GetDocImport(); + ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab()); + rDoc.setMatrixCells(aArrayRange, *pErgebnis, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1); } } |