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

Change-Id: I560b0beabe81907e3f85d8845041a9df25d2200d
This commit is contained in:
Kohei Yoshida
2014-04-11 00:55:10 -04:00
parent ed9d606306
commit 0e63ca4fde

View File

@@ -637,23 +637,26 @@ public:
ScFormulaCell* pTop = *rEntry.mpCells;
OUString aFormula = pTop->GetHybridFormula();
// Create a new token array from the hybrid formula string, and
// 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)
if (!aFormula.isEmpty())
{
ScFormulaCell* p = *pp;
p->SyncSharedCode();
p->SetDirty();
// Create a new token array from the hybrid formula string, and
// 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;
p->SyncSharedCode();
p->SetDirty();
}
}
}
else