diff options
author | Eike Rathke <erack@redhat.com> | 2017-05-19 20:21:03 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-22 11:00:56 +0200 |
commit | 3a3064fcb4778b050398d98598d6ed61e8298134 (patch) | |
tree | a8895762d246bad288e643977c917e6b196574c4 | |
parent | 6a569fd47e3665b0aaec397ace0346938bb3b4bf (diff) |
Introduce ScRefListToken::mbArrayResult for reference results, tdf#58874
Change-Id: Icd077a82ab0c951667a6566d5c5d47084c46d20d
-rw-r--r-- | sc/inc/token.hxx | 8 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index 7c082010ea93..8d561af85760 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -265,11 +265,15 @@ class ScRefListToken : public formula::FormulaToken { private: ScRefList aRefList; + bool mbArrayResult; // whether RefList is an array result public: ScRefListToken() : - FormulaToken( formula::svRefList ) {} + FormulaToken( formula::svRefList ), mbArrayResult(false) {} + explicit ScRefListToken( bool bArrayResult ) : + FormulaToken( formula::svRefList ), mbArrayResult( bArrayResult ) {} ScRefListToken( const ScRefListToken & r ) : - FormulaToken( r ), aRefList( r.aRefList ) {} + FormulaToken( r ), aRefList( r.aRefList ), mbArrayResult( r.mbArrayResult ) {} + bool IsArrayResult() const; virtual const ScRefList* GetRefList() const override; virtual ScRefList* GetRefList() override; virtual bool operator==( const formula::FormulaToken& rToken ) const override; diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 512fecc7f83f..ea2060d8c7a2 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -683,9 +683,12 @@ bool ScDoubleRefToken::operator==( const FormulaToken& r ) const const ScRefList* ScRefListToken::GetRefList() const { return &aRefList; } ScRefList* ScRefListToken::GetRefList() { return &aRefList; } + bool ScRefListToken::IsArrayResult() const { return mbArrayResult; } bool ScRefListToken::operator==( const FormulaToken& r ) const { - return FormulaToken::operator==( r ) && &aRefList == r.GetRefList(); + const ScRefListToken* p; + return FormulaToken::operator==( r ) && &aRefList == r.GetRefList() && + ((p = dynamic_cast<const ScRefListToken*>(&r)) != nullptr) && mbArrayResult == p->IsArrayResult(); } ScMatrixToken::ScMatrixToken( const ScMatrixRef& p ) : |