diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2017-12-03 21:46:37 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-12-19 22:08:26 +0100 |
commit | 00bc5a097313fbd003675267be961ad3a152ba42 (patch) | |
tree | de9b9e6981d3c2f262b9391335a067d4898185b6 /include/formula | |
parent | b74da08e556b7b001943f0288a61da53791d4dcf (diff) |
wrap scoped enum around css::util::NumberFormat
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa
Reviewed-on: https://gerrit.libreoffice.org/46339
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'include/formula')
-rw-r--r-- | include/formula/FormulaCompiler.hxx | 5 | ||||
-rw-r--r-- | include/formula/token.hxx | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index 852e996dad79..26d996f374e8 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -52,6 +52,7 @@ namespace com { namespace sun { namespace star { class CharClass; enum class FormulaError : sal_uInt16; +enum class SvNumFormatType : sal_Int16; namespace formula { @@ -236,7 +237,7 @@ public: static sal_Unicode GetNativeSymbolChar( OpCode eOp ); static bool IsMatrixFunction(OpCode _eOpCode); // if a function _always_ returns a Matrix - short GetNumFormatType() const { return nNumFmt; } + SvNumFormatType GetNumFormatType() const { return nNumFmt; } bool CompileTokenArray(); void CreateStringFromTokenArray( OUString& rFormula ); @@ -340,7 +341,7 @@ protected: OpCode eLastOp; short nRecursion; // GetToken() recursions - short nNumFmt; // set during CompileTokenArray() + SvNumFormatType nNumFmt; // set during CompileTokenArray() sal_uInt16 pc; // program counter FormulaGrammar::Grammar meGrammar; // The grammar used, language plus convention. diff --git a/include/formula/token.hxx b/include/formula/token.hxx index c3144b4a2dcb..d464ec67d39e 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -183,8 +183,8 @@ public: virtual void SetInForceArray( ParamClass c ); virtual double GetDouble() const; virtual double& GetDoubleAsReference(); - virtual short GetDoubleType() const; - virtual void SetDoubleType( short nType ); + virtual sal_Int16 GetDoubleType() const; + virtual void SetDoubleType( sal_Int16 nType ); virtual svl::SharedString GetString() const; virtual void SetString( const svl::SharedString& rStr ); virtual sal_uInt16 GetIndex() const; @@ -304,7 +304,7 @@ 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 sal_Int16 GetDoubleType() const override; ///< always returns 0 for "not typed" virtual bool operator==( const FormulaToken& rToken ) const override; DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken ) @@ -313,19 +313,19 @@ public: class FORMULA_DLLPUBLIC FormulaTypedDoubleToken : public FormulaDoubleToken { private: - short mnType; /**< Can hold, for example, a value - of css::util::NumberFormat, or by + sal_Int16 mnType; /**< Can hold, for example, a value + of SvNumFormatType, or by contract any other classification. */ public: - FormulaTypedDoubleToken( double f, short nType ) : + FormulaTypedDoubleToken( double f, sal_Int16 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 void SetDoubleType( short nType ) override; + virtual sal_Int16 GetDoubleType() const override; + virtual void SetDoubleType( sal_Int16 nType ) override; virtual bool operator==( const FormulaToken& rToken ) const override; DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaTypedDoubleToken ) |