summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--formula/source/core/api/token.cxx8
-rw-r--r--include/formula/token.hxx6
-rw-r--r--sc/source/core/tool/interpr4.cxx2
-rw-r--r--sc/source/core/tool/token.cxx2
4 files changed, 6 insertions, 12 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index b384f091db67..a7fc6a06868d 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -188,12 +188,10 @@ double FormulaToken::GetDouble() const
return 0.0;
}
-double & FormulaToken::GetDoubleAsReference()
+void FormulaToken::SetDouble(double)
{
// This Get is worth an assert.
assert( !"virtual dummy called" );
- static double fVal = 0.0;
- return fVal;
}
sal_Int16 FormulaToken::GetDoubleType() const
@@ -1900,10 +1898,6 @@ void FormulaTokenArrayPlainIterator::AfterRemoveToken( sal_uInt16 nOffset, sal_u
// real implementations of virtual functions
-
-double FormulaDoubleToken::GetDouble() const { return fDouble; }
-double & FormulaDoubleToken::GetDoubleAsReference() { return fDouble; }
-
sal_Int16 FormulaDoubleToken::GetDoubleType() const
{
// This is a plain double value without type information, don't emit a
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 6fd5670e36b0..68461a48db1d 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -212,7 +212,7 @@ public:
virtual ParamClass GetInForceArray() const;
virtual void SetInForceArray( ParamClass c );
virtual double GetDouble() const;
- virtual double& GetDoubleAsReference();
+ virtual void SetDouble(double fValue);
virtual sal_Int16 GetDoubleType() const;
virtual void SetDoubleType( sal_Int16 nType );
virtual const svl::SharedString & GetString() const;
@@ -340,8 +340,8 @@ public:
FormulaToken( r ), fDouble( r.fDouble ) {}
virtual FormulaToken* Clone() const override { return new FormulaDoubleToken(*this); }
- virtual double GetDouble() const override final;
- virtual double& GetDoubleAsReference() override final;
+ virtual double GetDouble() const override final { return fDouble; }
+ virtual void SetDouble(double fValue) override final { fDouble = fValue; }
virtual sal_Int16 GetDoubleType() const override; ///< always returns 0 for "not typed"
virtual bool operator==( const FormulaToken& rToken ) const override;
};
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 3c4de96e0607..77dbd7d52014 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1775,7 +1775,7 @@ formula::FormulaToken* ScInterpreter::CreateFormulaDoubleToken( double fVal, SvN
{
if (p && p->GetRef() == 1)
{
- p->GetDoubleAsReference() = fVal;
+ p->SetDouble(fVal);
p->SetDoubleType( static_cast<sal_Int16>(nFmt) );
return p;
}
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f2d21ca74963..33e520723213 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1083,7 +1083,7 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f )
switch (GetUpperLeftType())
{
case svDouble:
- const_cast<FormulaToken*>(xUpperLeft.get())->GetDoubleAsReference() = f;
+ const_cast<FormulaToken*>(xUpperLeft.get())->SetDouble(f);
break;
case svString:
xUpperLeft = new FormulaDoubleToken( f);