Kaydet (Commit) efc66942 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

no need to recompile the formula again

Change-Id: I03b72bd6a0b341ec89e0995f7b53287449ce9f61
üst cbbf5876
......@@ -30,7 +30,6 @@ private:
ScAddress maAddr;
ScDocument* mpDoc;
ScFormulaResult maResult;
const OUString maFormula;
formula::FormulaGrammar::Grammar maGram;
bool bIsMatrix;
OUString maMatrixFormulaResult;
......
......@@ -20,7 +20,6 @@ ScSimpleFormulaCalculator::ScSimpleFormulaCalculator( ScDocument* pDoc, const Sc
, mbCalculated(false)
, maAddr(rAddr)
, mpDoc(pDoc)
, maFormula(rFormula)
, maGram(eGram)
, bIsMatrix(false)
{
......@@ -48,15 +47,13 @@ void ScSimpleFormulaCalculator::Calculate()
formula::StackVar aIntType = aInt.Interpret();
if ( aIntType == formula::svMatrixCell )
{
OUStringBuffer aStr;
ScCompiler aComp(mpDoc, maAddr);
aComp.SetGrammar(maGram);
mpCode.reset(aComp.CompileString(maFormula));
if(!mpCode->GetCodeError() && mpCode->GetLen())
aComp.CompileTokenArray();
aComp.CreateStringFromToken( aStr, aInt.GetResultToken().get(), true );
OUStringBuffer aStr;
aComp.CreateStringFromToken(aStr, aInt.GetResultToken().get(), false);
bIsMatrix = true;
maMatrixFormulaResult = aStr.toString();
maMatrixFormulaResult = aStr.makeStringAndClear();
}
mnFormatType = aInt.GetRetFormatType();
mnFormatIndex = aInt.GetRetFormatIndex();
......@@ -69,6 +66,7 @@ bool ScSimpleFormulaCalculator::IsValue()
if (bIsMatrix)
return false;
return maResult.IsValue();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment