diff options
author | Eike Rathke <erack@redhat.com> | 2016-06-08 12:03:39 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-06-08 12:13:23 +0200 |
commit | 1ec01a340a063ef6d1b773e6a693c09234bd4f27 (patch) | |
tree | 4a009699b76ad76e9f1183f580adb40336e1b2dd /include/formula | |
parent | ScDPResultTree::ValuesType can be empty (diff) | |
download | core-1ec01a340a063ef6d1b773e6a693c09234bd4f27.tar.gz core-1ec01a340a063ef6d1b773e6a693c09234bd4f27.zip |
introduce FormulaTypedDoubleToken to carry type information of a double
Change-Id: I88b4964ca95eefa41d415ed66fc106c834a686b6
Diffstat (limited to 'include/formula')
-rw-r--r-- | include/formula/token.hxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/formula/token.hxx b/include/formula/token.hxx index 3d265f63441b..f195b68ecc38 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -151,6 +151,7 @@ public: virtual void SetInForceArray( bool b ); virtual double GetDouble() const; virtual double& GetDoubleAsReference(); + virtual short GetDoubleType() const; virtual svl::SharedString GetString() const; virtual void SetString( const svl::SharedString& rStr ); virtual sal_uInt16 GetIndex() const; @@ -270,11 +271,32 @@ public: virtual FormulaToken* Clone() const override { return new FormulaDoubleToken(*this); } virtual double GetDouble() const override; virtual double& GetDoubleAsReference() override; + virtual short GetDoubleType() const override; ///< always returns 0 for "not typed" virtual bool operator==( const FormulaToken& rToken ) const override; DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken ) }; +class FORMULA_DLLPUBLIC FormulaTypedDoubleToken : public FormulaDoubleToken +{ +private: + short mnType; /**< Can hold, for example, a value + of css::util::NumberFormat, or by + contract any other + classification. */ +public: + FormulaTypedDoubleToken( double f, short nType ) : + FormulaDoubleToken( f ), mnType( nType ) {} + FormulaTypedDoubleToken( const FormulaTypedDoubleToken& r ) : + FormulaDoubleToken( r ), mnType( r.mnType ) {} + + virtual FormulaToken* Clone() const override { return new FormulaTypedDoubleToken(*this); } + virtual short GetDoubleType() const override; + virtual bool operator==( const FormulaToken& rToken ) const override; + + DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaTypedDoubleToken ) +}; + class FORMULA_DLLPUBLIC FormulaStringToken : public FormulaToken { |