diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-16 16:03:51 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-16 18:09:00 +0200 |
commit | b06c374a3f2acbd1412bb195fc424ff3ce64d8b2 (patch) | |
tree | 690dda25a878f957df6bc5ea3ed1d752c7743c96 /sc | |
parent | dbf05779a3986ad03960196c216118a258110bb7 (diff) |
add formula cells/groups to the cache
Change-Id: I04a8055f4df27a080291362ef31ccf559fa709cf
Reviewed-on: https://gerrit.libreoffice.org/41219
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/column4.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index ee1324cf6651..8ded9168246d 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -1689,7 +1689,34 @@ public: break; case sc::element_type_formula: { - mrStrm.WriteUChar(2); + mrStrm.WriteUChar(3); + sc::formula_block::const_iterator it = sc::formula_block::begin(*node.data); + std::advance(it, nOffset); + sc::formula_block::const_iterator itEnd = it; + std::advance(itEnd, nDataSize); + + for (; it != itEnd; /* incrementing throug std::advance*/) + { + const ScFormulaCell* pCell = *it; + OUString aFormula; + pCell->GetFormula(aFormula, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1); + auto xCellGroup = pCell->GetCellGroup(); + sal_uInt64 nGroupLength = 0; + if (xCellGroup) + { + nGroupLength = xCellGroup->mnLength; + } + else + { + nGroupLength = 1; + } + mrStrm.WriteUInt64(nGroupLength); + mrStrm.WriteInt32(aFormula.getLength()); + mrStrm.WriteCharPtr(OUStringToOString(aFormula, RTL_TEXTENCODING_UTF8).getStr()); + + // incrementing the iterator + std::advance(it, nGroupLength); + } } break; } |