summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-02 21:33:09 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-03-03 10:26:46 -0500
commite418258a4a71dd8d334e318dca9a241772250f31 (patch)
treeae6158573d644a55ab399776cf45af1f221b621a /sc
parenta0ce81d25f7997df35436b71f6a927cdf419b9f0 (diff)
Better fix for fdo#31939.
Turns out that the token array's recalc mode is set to "recalc always" when it contains a volatile token during compilation. We can re-use that to mark the token array volatile before the interpretation starts. The end result is the same, with better performance since we can avoid re-scanning of the token array. Signed-off-by: Michael Meeks <michael.meeks@novell.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/inc/interpre.hxx7
-rw-r--r--sc/source/core/tool/interpr4.cxx4
-rw-r--r--sc/source/core/tool/interpr7.cxx13
3 files changed, 2 insertions, 22 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index e2eae906dbc4..6e5fd10e2ebe 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -813,13 +813,6 @@ double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
// cumulative distribution function; fLambda is "scale" parameter
double GetGammaDist(double fX, double fAlpha, double fLambda);
-/**
- * Go through all tokens to see if the array contains a volatile token. We
- * need to do this since a conditional token such as IF function may skip
- * some tokens and it may incorrectly mark the token array non-volatile.
- */
-void CheckForVolatileToken();
-
public:
ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
const ScAddress&, ScTokenArray& );
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 6751531be0eb..502c62ab0462 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3594,7 +3594,7 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
pFormatter( pDoc->GetFormatTable() ),
mnStringNoValueError( errNoValue),
bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() ),
- meVolaileType(NOT_VOLATILE)
+ meVolaileType(r.IsRecalcModeAlways() ? VOLATILE : NOT_VOLATILE)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" );
// pStack = new ScToken*[ MAXSTACK ];
@@ -3663,8 +3663,6 @@ StackVar ScInterpreter::Interpret()
// so reassure exceptions are really off.
SAL_MATH_FPEXCEPTIONS_OFF();
- CheckForVolatileToken();
-
aCode.Reset();
while( ( pCur = aCode.Next() ) != NULL
&& (!nGlobalError || nErrorFunction <= nErrorFunctionCount) )
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index c7674d6ff887..ffac3d686501 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -32,18 +32,7 @@
// INCLUDE ---------------------------------------------------------------
#include "interpre.hxx"
-#include "formula/FormulaCompiler.hxx"
-void ScInterpreter::CheckForVolatileToken()
-{
- for (const formula::FormulaToken* p = aCode.First(); p; p = aCode.Next())
- {
- if (formula::FormulaCompiler::IsOpCodeVolatile(p->GetOpCode()))
- {
- meVolaileType = VOLATILE;
- return;
- }
- }
-}
+// TODO: Add new methods for ScInterpreter here.
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */