From e462eb1183c0e52c06786296b39c121ea3671199 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 4 Sep 2013 18:33:41 -0400 Subject: Allow storage of string arrays in vector ref tokens. Change-Id: Id2bc5a0343afeae387d896a9c369586a13081cd5 --- include/formula/vectortoken.hxx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/formula/vectortoken.hxx b/include/formula/vectortoken.hxx index d3d05111ccf4..5186ca526922 100644 --- a/include/formula/vectortoken.hxx +++ b/include/formula/vectortoken.hxx @@ -14,21 +14,36 @@ namespace formula { +struct FORMULA_DLLPUBLIC VectorRefArray +{ + union { + const double* mpNumericArray; + const OUString* mpStringArray; + }; + + bool mbNumeric; + + VectorRefArray(); + VectorRefArray( const double* pArray ); + VectorRefArray( const OUString* pArray ); +}; + /** * This token represents a single cell reference in a vectorized formula * calculation context. */ class FORMULA_DLLPUBLIC SingleVectorRefToken : public FormulaToken { - const double* mpArray; + VectorRefArray maArray; size_t mnArrayLength; public: SingleVectorRefToken( const double* pArray, size_t nLength ); + SingleVectorRefToken( const VectorRefArray& rArray, size_t nLength ); virtual FormulaToken* Clone() const; - const double* GetArray() const; + const VectorRefArray& GetArray() const; size_t GetArrayLength() const; }; @@ -38,7 +53,7 @@ public: */ class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken { - std::vector maArrays; + std::vector maArrays; size_t mnArrayLength; /// length of all arrays. size_t mnRefRowSize; /// original reference row size. The row size may @@ -50,11 +65,11 @@ class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken public: DoubleVectorRefToken( - const std::vector& rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed ); + const std::vector& rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed ); virtual FormulaToken* Clone() const; - const std::vector& GetArrays() const; + const std::vector& GetArrays() const; size_t GetArrayLength() const; size_t GetRefRowSize() const; bool IsStartFixed() const; -- cgit