Kaydet (Commit) 0e63ca4f authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#77300: Do the same for the shared formula case as well.

Change-Id: I560b0beabe81907e3f85d8845041a9df25d2200d
üst ed9d6063
...@@ -637,23 +637,26 @@ public: ...@@ -637,23 +637,26 @@ public:
ScFormulaCell* pTop = *rEntry.mpCells; ScFormulaCell* pTop = *rEntry.mpCells;
OUString aFormula = pTop->GetHybridFormula(); OUString aFormula = pTop->GetHybridFormula();
// Create a new token array from the hybrid formula string, and if (!aFormula.isEmpty())
// set it to the group.
ScCompiler aComp(mrCompileFormulaCxt, pTop->aPos);
ScTokenArray* pNewCode = aComp.CompileString(aFormula);
ScFormulaCellGroupRef xGroup = pTop->GetCellGroup();
assert(xGroup);
xGroup->setCode(pNewCode);
xGroup->compileCode(*mpDoc, pTop->aPos, mpDoc->GetGrammar());
// Propagate the new token array to all formula cells in the group.
ScFormulaCell** pp = rEntry.mpCells;
ScFormulaCell** ppEnd = pp + rEntry.mnLength;
for (; pp != ppEnd; ++pp)
{ {
ScFormulaCell* p = *pp; // Create a new token array from the hybrid formula string, and
p->SyncSharedCode(); // set it to the group.
p->SetDirty(); ScCompiler aComp(mrCompileFormulaCxt, pTop->aPos);
ScTokenArray* pNewCode = aComp.CompileString(aFormula);
ScFormulaCellGroupRef xGroup = pTop->GetCellGroup();
assert(xGroup);
xGroup->setCode(pNewCode);
xGroup->compileCode(*mpDoc, pTop->aPos, mpDoc->GetGrammar());
// Propagate the new token array to all formula cells in the group.
ScFormulaCell** pp = rEntry.mpCells;
ScFormulaCell** ppEnd = pp + rEntry.mnLength;
for (; pp != ppEnd; ++pp)
{
ScFormulaCell* p = *pp;
p->SyncSharedCode();
p->SetDirty();
}
} }
} }
else else
......
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