summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-09-04 18:33:41 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-09-06 01:38:31 -0400
commite462eb1183c0e52c06786296b39c121ea3671199 (patch)
tree55efc399557f44b69267f2e3b33057989e693e91 /include
parent69047ec117cd2e0885efec1824e9c00555da4800 (diff)
Allow storage of string arrays in vector ref tokens.
Change-Id: Id2bc5a0343afeae387d896a9c369586a13081cd5
Diffstat (limited to 'include')
-rw-r--r--include/formula/vectortoken.hxx25
1 files changed, 20 insertions, 5 deletions
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<const double*> maArrays;
+ std::vector<VectorRefArray> 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<const double*>& rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed );
+ const std::vector<VectorRefArray>& rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed );
virtual FormulaToken* Clone() const;
- const std::vector<const double*>& GetArrays() const;
+ const std::vector<VectorRefArray>& GetArrays() const;
size_t GetArrayLength() const;
size_t GetRefRowSize() const;
bool IsStartFixed() const;