diff options
-rw-r--r-- | formula/source/core/api/token.cxx | 65 | ||||
-rw-r--r-- | include/formula/token.hxx | 21 | ||||
-rw-r--r-- | sc/inc/token.hxx | 27 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 65 |
4 files changed, 86 insertions, 92 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 5ce44e82ff6c..06cc8126bb51 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -254,6 +254,71 @@ void FormulaToken::SetError( sal_uInt16 ) SAL_WARN( "formula.core", "FormulaToken::SetError: virtual dummy called" ); } +const ScSingleRefData* FormulaToken::GetSingleRef() const +{ + OSL_FAIL( "FormulaToken::GetSingleRef: virtual dummy called" ); + return nullptr; +} + +ScSingleRefData* FormulaToken::GetSingleRef() +{ + OSL_FAIL( "FormulaToken::GetSingleRef: virtual dummy called" ); + return nullptr; +} + +const ScComplexRefData* FormulaToken::GetDoubleRef() const +{ + OSL_FAIL( "FormulaToken::GetDoubleRef: virtual dummy called" ); + return nullptr; +} + +ScComplexRefData* FormulaToken::GetDoubleRef() +{ + OSL_FAIL( "FormulaToken::GetDoubleRef: virtual dummy called" ); + return nullptr; +} + +const ScSingleRefData* FormulaToken::GetSingleRef2() const +{ + OSL_FAIL( "FormulaToken::GetSingleRef2: virtual dummy called" ); + return nullptr; +} + +ScSingleRefData* FormulaToken::GetSingleRef2() +{ + OSL_FAIL( "FormulaToken::GetSingleRef2: virtual dummy called" ); + return nullptr; +} + +const ScMatrix* FormulaToken::GetMatrix() const +{ + OSL_FAIL( "FormulaToken::GetMatrix: virtual dummy called" ); + return NULL; +} + +ScMatrix* FormulaToken::GetMatrix() +{ + OSL_FAIL( "FormulaToken::GetMatrix: virtual dummy called" ); + return NULL; +} + +ScJumpMatrix* FormulaToken::GetJumpMatrix() const +{ + OSL_FAIL( "FormulaToken::GetJumpMatrix: virtual dummy called" ); + return NULL; +} +const std::vector<ScComplexRefData>* FormulaToken::GetRefList() const +{ + OSL_FAIL( "FormulaToken::GetRefList: virtual dummy called" ); + return NULL; +} + +std::vector<ScComplexRefData>* FormulaToken::GetRefList() +{ + OSL_FAIL( "FormulaToken::GetRefList: virtual dummy called" ); + return NULL; +} + bool FormulaToken::TextEqual( const FormulaToken& rToken ) const { return *this == rToken; diff --git a/include/formula/token.hxx b/include/formula/token.hxx index e3f6a2686ea9..09addbc7c7ff 100644 --- a/include/formula/token.hxx +++ b/include/formula/token.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_FORMULA_TOKEN_HXX #define INCLUDED_FORMULA_TOKEN_HXX +#include <sal/config.h> + +#include <vector> + #include <string.h> #include <formula/opcode.hxx> #include <tools/mempool.hxx> @@ -29,6 +33,11 @@ #include <svl/sharedstring.hxx> #include <osl/interlck.h> +class ScJumpMatrix; +class ScMatrix; +struct ScComplexRefData; +struct ScSingleRefData; + namespace formula { @@ -154,6 +163,18 @@ public: virtual sal_uInt16 GetError() const; virtual void SetError( sal_uInt16 ); + virtual const ScSingleRefData* GetSingleRef() const; + virtual ScSingleRefData* GetSingleRef(); + virtual const ScComplexRefData* GetDoubleRef() const; + virtual ScComplexRefData* GetDoubleRef(); + virtual const ScSingleRefData* GetSingleRef2() const; + virtual ScSingleRefData* GetSingleRef2(); + virtual const ScMatrix* GetMatrix() const; + virtual ScMatrix* GetMatrix(); + virtual ScJumpMatrix* GetJumpMatrix() const; + virtual const std::vector<ScComplexRefData>* GetRefList() const; + virtual std::vector<ScComplexRefData>* GetRefList(); + virtual FormulaToken* Clone() const { return new FormulaToken(*this); } virtual bool TextEqual( const formula::FormulaToken& rToken ) const; diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index 72db3651f230..d065518d7fbc 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -62,33 +62,6 @@ protected: public: virtual ~ScToken(); - - /** - Dummy methods to avoid switches and casts where possible, - the real token classes have to overload the appropriate method[s]. - The only methods valid anytime if not overloaded are: - - - GetByte() since this represents the count of parameters to a function - which of course is 0 on non-functions. formula::FormulaByteToken and ScExternal do - overload it. - - - HasForceArray() since also this is only used for operators and - functions and is 0 for other tokens. - - Any other non-overloaded method pops up an assertion. - */ - - virtual const ScSingleRefData* GetSingleRef() const; - virtual ScSingleRefData* GetSingleRef(); - virtual const ScComplexRefData* GetDoubleRef() const; - virtual ScComplexRefData* GetDoubleRef(); - virtual const ScSingleRefData* GetSingleRef2() const; - virtual ScSingleRefData* GetSingleRef2(); - virtual const ScMatrix* GetMatrix() const; - virtual ScMatrix* GetMatrix(); - virtual ScJumpMatrix* GetJumpMatrix() const; - virtual const ScRefList* GetRefList() const; - virtual ScRefList* GetRefList(); }; #if DEBUG_FORMULA_COMPILER diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c8d47e43945b..a24cdd6e957a 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -637,71 +637,6 @@ FormulaTokenRef extendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2 return FormulaTokenRef(xRes.get()); } -const ScSingleRefData* ScToken::GetSingleRef() const -{ - OSL_FAIL( "ScToken::GetSingleRef: virtual dummy called" ); - return nullptr; -} - -ScSingleRefData* ScToken::GetSingleRef() -{ - OSL_FAIL( "ScToken::GetSingleRef: virtual dummy called" ); - return nullptr; -} - -const ScComplexRefData* ScToken::GetDoubleRef() const -{ - OSL_FAIL( "ScToken::GetDoubleRef: virtual dummy called" ); - return nullptr; -} - -ScComplexRefData* ScToken::GetDoubleRef() -{ - OSL_FAIL( "ScToken::GetDoubleRef: virtual dummy called" ); - return nullptr; -} - -const ScSingleRefData* ScToken::GetSingleRef2() const -{ - OSL_FAIL( "ScToken::GetSingleRef2: virtual dummy called" ); - return nullptr; -} - -ScSingleRefData* ScToken::GetSingleRef2() -{ - OSL_FAIL( "ScToken::GetSingleRef2: virtual dummy called" ); - return nullptr; -} - -const ScMatrix* ScToken::GetMatrix() const -{ - OSL_FAIL( "ScToken::GetMatrix: virtual dummy called" ); - return NULL; -} - -ScMatrix* ScToken::GetMatrix() -{ - OSL_FAIL( "ScToken::GetMatrix: virtual dummy called" ); - return NULL; -} - -ScJumpMatrix* ScToken::GetJumpMatrix() const -{ - OSL_FAIL( "ScToken::GetJumpMatrix: virtual dummy called" ); - return NULL; -} -const ScRefList* ScToken::GetRefList() const -{ - OSL_FAIL( "ScToken::GetRefList: virtual dummy called" ); - return NULL; -} - -ScRefList* ScToken::GetRefList() -{ - OSL_FAIL( "ScToken::GetRefList: virtual dummy called" ); - return NULL; -} - // real implementations of virtual functions const ScSingleRefData* ScSingleRefToken::GetSingleRef() const { return &aSingleRef; } |