summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-04-11 00:55:10 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-04-11 00:56:10 -0400
commit0e63ca4fde4e446f346e35849c756a30ca294aab (patch)
tree376e5de7bb62706a29f8a72f73c76339234274c9
parented9d606306cc66ec89e9a6696494b6cdefd9b208 (diff)
fdo#77300: Do the same for the shared formula case as well.
Change-Id: I560b0beabe81907e3f85d8845041a9df25d2200d
-rw-r--r--sc/source/core/data/column4.cxx35
1 files changed, 19 insertions, 16 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 7d87177cddfe..ec938d88aeb4 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -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