summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-12-06 22:58:25 +0100
committerEike Rathke <erack@redhat.com>2013-12-06 23:06:18 +0100
commit039dadf3b48484ba5d1fc71de5561288e6b7c5cb (patch)
tree8a9f1956d597ee43cb102b8b1335e750c0e39da9
parent85b6167276e6dc1298e9343af06cafb0ea1fde98 (diff)
resolved fdo#66564 calculate formula cell once if AutoCalc disabled
Was lost with 2ce72093cdc68e60fb06ddd4358e0bc7fc8c63a9 and previous restructuring. Change-Id: Ie4c8bdb287b56448406c873840c26ec4759de375 (cherry picked from commit 2212051e792cb5f51f4191afe83c85fc3730a087)
-rw-r--r--sc/source/ui/docshell/docfunc.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index c0295e4bfc5e..72e7e469db62 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -946,7 +946,19 @@ bool ScDocFunc::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, boo
if (bUndo)
aOldVal.assign(*pDoc, rPos);
- pDoc->SetFormulaCell(rPos, xCell.release());
+ pCell = pDoc->SetFormulaCell(rPos, xCell.release());
+
+ // For performance reasons API calls may disable calculation while
+ // operating and recalculate once when done. If through user interaction
+ // and AutoCalc is disabled, calculate the formula (without its
+ // dependencies) once so the result matches the current document's content.
+ if (bInteraction && !pDoc->GetAutoCalc() && pCell)
+ {
+ // calculate just the cell once and set Dirty again
+ pCell->Interpret();
+ pCell->SetDirtyVar();
+ pDoc->PutInFormulaTree( pCell);
+ }
if (bUndo)
{