[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Mar 2 18:35:39 PST 2011
sc/source/core/inc/interpre.hxx | 7 -------
sc/source/core/tool/interpr4.cxx | 4 +---
sc/source/core/tool/interpr7.cxx | 13 +------------
3 files changed, 2 insertions(+), 22 deletions(-)
New commits:
commit a61620da9c3e13c665d99dc3c8267086c8bfe641
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Mar 2 21:33:09 2011 -0500
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.
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 68aefe9..aa36629 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -804,13 +804,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 e363288..a7cfb71 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3581,7 +3581,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" );
@@ -3648,8 +3648,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 c7674d6..ffac3d6 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: */
More information about the Libreoffice-commits
mailing list