Kaydet (Commit) b06c374a authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add formula cells/groups to the cache

Change-Id: I04a8055f4df27a080291362ef31ccf559fa709cf
Reviewed-on: https://gerrit.libreoffice.org/41219Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst dbf05779
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment