summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-04-29 17:30:23 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-04-30 13:10:43 -0400
commitdfc3f290b5934326a8e042eb81c1b2c81ee0a1ec (patch)
tree9a136e82f806600ecb085467a4ea9fd8aceff781
parentc45c6307d23d8ceae9d567d2f7286c161b9cb5a9 (diff)
Let's not use VectorArray struct. There is no use for it.
Change-Id: Ic011143206c13fcbc1b3403bf5b7df46c6934899
-rw-r--r--formula/source/core/api/vectortoken.cxx20
-rw-r--r--include/formula/vectortoken.hxx17
-rw-r--r--sc/source/core/data/formulacell.cxx4
3 files changed, 19 insertions, 22 deletions
diff --git a/formula/source/core/api/vectortoken.cxx b/formula/source/core/api/vectortoken.cxx
index 94a071cd02d7..e016fd3700b0 100644
--- a/formula/source/core/api/vectortoken.cxx
+++ b/formula/source/core/api/vectortoken.cxx
@@ -11,24 +11,26 @@
namespace formula {
-VectorArray::VectorArray( const double* pArray, size_t nLength ) :
- mpArray(pArray), mnLength(nLength) {}
-
SingleVectorRefToken::SingleVectorRefToken( const double* pArray, size_t nLength ) :
- FormulaToken(svSingleVectorRef, ocPush), maArray(pArray, nLength) {}
+ FormulaToken(svSingleVectorRef, ocPush), mpArray(pArray), mnLength(nLength) {}
FormulaToken* SingleVectorRefToken::Clone() const
{
- return new SingleVectorRefToken(maArray.mpArray, maArray.mnLength);
+ return new SingleVectorRefToken(mpArray, mnLength);
+}
+
+const double* SingleVectorRefToken::GetArray() const
+{
+ return mpArray;
}
-const VectorArray& SingleVectorRefToken::GetArray() const
+size_t SingleVectorRefToken::GetLength() const
{
- return maArray;
+ return mnLength;
}
DoubleVectorRefToken::DoubleVectorRefToken(
- const std::vector<VectorArray>& rArrays, size_t nRowSize, bool bAbsStart, bool bAbsEnd ) :
+ const std::vector<const double*>& rArrays, size_t nRowSize, bool bAbsStart, bool bAbsEnd ) :
FormulaToken(svDoubleVectorRef, ocPush),
maArrays(rArrays), mnRowSize(nRowSize), mbAbsStart(bAbsStart), mbAbsEnd(bAbsEnd) {}
@@ -37,7 +39,7 @@ FormulaToken* DoubleVectorRefToken::Clone() const
return new DoubleVectorRefToken(maArrays, mnRowSize, mbAbsStart, mbAbsEnd);
}
-const std::vector<VectorArray>& DoubleVectorRefToken::GetArrays() const
+const std::vector<const double*>& DoubleVectorRefToken::GetArrays() const
{
return maArrays;
}
diff --git a/include/formula/vectortoken.hxx b/include/formula/vectortoken.hxx
index 82051d4275cc..db44355cf824 100644
--- a/include/formula/vectortoken.hxx
+++ b/include/formula/vectortoken.hxx
@@ -14,23 +14,18 @@
namespace formula {
-struct VectorArray
+class FORMULA_DLLPUBLIC SingleVectorRefToken : public FormulaToken
{
const double* mpArray;
size_t mnLength;
- VectorArray( const double* pArray, size_t nLength );
-};
-
-class FORMULA_DLLPUBLIC SingleVectorRefToken : public FormulaToken
-{
- const VectorArray maArray;
public:
SingleVectorRefToken( const double* pArray, size_t nLength );
virtual FormulaToken* Clone() const;
- const VectorArray& GetArray() const;
+ const double* GetArray() const;
+ size_t GetLength() const;
};
/**
@@ -39,7 +34,7 @@ public:
*/
class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken
{
- std::vector<VectorArray> maArrays;
+ std::vector<const double*> maArrays;
size_t mnRowSize;
@@ -48,11 +43,11 @@ class FORMULA_DLLPUBLIC DoubleVectorRefToken : public FormulaToken
public:
DoubleVectorRefToken(
- const std::vector<VectorArray>& rArrays, size_t nRowSize, bool bAbsStart, bool bAbsEnd );
+ const std::vector<const double*>& rArrays, size_t nRowSize, bool bAbsStart, bool bAbsEnd );
virtual FormulaToken* Clone() const;
- const std::vector<VectorArray>& GetArrays() const;
+ const std::vector<const double*>& GetArrays() const;
};
}
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index 5753e44ebd7a..ba039b6e7422 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -3063,8 +3063,8 @@ bool ScFormulaCell::InterpretFormulaGroup()
case svSingleVectorRef:
{
const formula::SingleVectorRefToken* p2 = static_cast<const formula::SingleVectorRefToken*>(p);
- const formula::VectorArray& rArray = p2->GetArray();
- aCode2.AddDouble(rArray.mpArray[i]);
+ const double* pArray = p2->GetArray();
+ aCode2.AddDouble(pArray[i]);
}
break;
case svDoubleVectorRef: