summaryrefslogtreecommitdiff
path: root/formula
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 /formula
parent69047ec117cd2e0885efec1824e9c00555da4800 (diff)
Allow storage of string arrays in vector ref tokens.
Change-Id: Id2bc5a0343afeae387d896a9c369586a13081cd5
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/vectortoken.cxx19
1 files changed, 13 insertions, 6 deletions
diff --git a/formula/source/core/api/vectortoken.cxx b/formula/source/core/api/vectortoken.cxx
index 74339397448b..557e0c058595 100644
--- a/formula/source/core/api/vectortoken.cxx
+++ b/formula/source/core/api/vectortoken.cxx
@@ -11,17 +11,24 @@
namespace formula {
+VectorRefArray::VectorRefArray() : mpNumericArray(NULL), mbNumeric(true) {}
+VectorRefArray::VectorRefArray( const double* pArray ) : mpNumericArray(pArray), mbNumeric(true) {}
+VectorRefArray::VectorRefArray( const OUString* pArray ) : mpStringArray(pArray), mbNumeric(false) {}
+
SingleVectorRefToken::SingleVectorRefToken( const double* pArray, size_t nLength ) :
- FormulaToken(svSingleVectorRef, ocPush), mpArray(pArray), mnArrayLength(nLength) {}
+ FormulaToken(svSingleVectorRef, ocPush), maArray(pArray), mnArrayLength(nLength) {}
+
+SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray& rArray, size_t nLength ) :
+ FormulaToken(svSingleVectorRef, ocPush), maArray(rArray), mnArrayLength(nLength) {}
FormulaToken* SingleVectorRefToken::Clone() const
{
- return new SingleVectorRefToken(mpArray, mnArrayLength);
+ return new SingleVectorRefToken(maArray, mnArrayLength);
}
-const double* SingleVectorRefToken::GetArray() const
+const VectorRefArray& SingleVectorRefToken::GetArray() const
{
- return mpArray;
+ return maArray;
}
size_t SingleVectorRefToken::GetArrayLength() const
@@ -30,7 +37,7 @@ size_t SingleVectorRefToken::GetArrayLength() const
}
DoubleVectorRefToken::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 ) :
FormulaToken(svDoubleVectorRef, ocPush),
maArrays(rArrays), mnArrayLength(nArrayLength), mnRefRowSize(nRefRowSize), mbStartFixed(bStartFixed), mbEndFixed(bEndFixed) {}
@@ -39,7 +46,7 @@ FormulaToken* DoubleVectorRefToken::Clone() const
return new DoubleVectorRefToken(maArrays, mnArrayLength, mnRefRowSize, mbStartFixed, mbEndFixed);
}
-const std::vector<const double*>& DoubleVectorRefToken::GetArrays() const
+const std::vector<VectorRefArray>& DoubleVectorRefToken::GetArrays() const
{
return maArrays;
}