From d9cde132b5a98dee61e0d0ce228e5008e699f37d Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Tue, 8 Apr 2014 02:56:13 +0200 Subject: add array cell import to orcus import Change-Id: I4f6dab039389e6b07486162df8bf939b557e7ed8 --- sc/source/filter/orcus/interface.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 7a89b62b6d7e..085a2d624592 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -358,9 +358,21 @@ void ScOrcusSheet::set_shared_formula(os::row_t row, os::col_t col, size_t sinde } void ScOrcusSheet::set_array_formula( - os::row_t /*row*/, os::col_t /*col*/, os::formula_grammar_t /*grammar*/, - const char* /*p*/, size_t /*n*/, os::row_t /*array_rows*/, os::col_t /*array_cols*/) + os::row_t row, os::col_t col, os::formula_grammar_t grammar, + const char* p, size_t n, os::row_t array_rows, os::col_t array_cols) { + formula::FormulaGrammar::Grammar eGrammar = getCalcGrammarFromOrcus( grammar ); + OUString aFormula(p, n, RTL_TEXTENCODING_UTF8); + + ScRange aRange(col, row, mnTab, col+array_cols, row + array_rows, mnTab); + + ScCompiler aComp(&mrDoc.getDoc(), aRange.aStart); + aComp.SetGrammar(eGrammar); + boost::scoped_ptr pArray(aComp.CompileString(aFormula)); + if (!pArray) + return; + + mrDoc.setMatrixCells(aRange, *pArray, eGrammar); } void ScOrcusSheet::set_array_formula( -- cgit