Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #include "formula/vectortoken.hxx"
11 :
12 : namespace formula {
13 :
14 0 : VectorRefArray::VectorRefArray() :
15 : mpNumericArray(NULL),
16 : mpStringArray(NULL),
17 0 : mbValid(true) {}
18 :
19 0 : VectorRefArray::VectorRefArray( InitInvalid ) :
20 : mpNumericArray(NULL),
21 : mpStringArray(NULL),
22 0 : mbValid(false) {}
23 :
24 14 : VectorRefArray::VectorRefArray( const double* pArray ) :
25 : mpNumericArray(pArray),
26 : mpStringArray(NULL),
27 14 : mbValid(true) {}
28 :
29 6 : VectorRefArray::VectorRefArray( rtl_uString** pArray ) :
30 : mpNumericArray(NULL),
31 : mpStringArray(pArray),
32 6 : mbValid(true) {}
33 :
34 20 : VectorRefArray::VectorRefArray( const double* pNumArray, rtl_uString** pStrArray ) :
35 : mpNumericArray(pNumArray),
36 : mpStringArray(pStrArray),
37 20 : mbValid(true) {}
38 :
39 32 : bool VectorRefArray::isValid() const
40 : {
41 32 : return mbValid;
42 : }
43 :
44 0 : SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray& rArray, size_t nReqLength, size_t nArrayLength ) :
45 0 : FormulaToken(svSingleVectorRef, ocPush), maArray(rArray), mnRequestedLength(nReqLength), mnArrayLength(nArrayLength) {}
46 :
47 0 : FormulaToken* SingleVectorRefToken::Clone() const
48 : {
49 0 : return new SingleVectorRefToken(maArray, mnRequestedLength, mnArrayLength);
50 : }
51 :
52 0 : const VectorRefArray& SingleVectorRefToken::GetArray() const
53 : {
54 0 : return maArray;
55 : }
56 :
57 0 : size_t SingleVectorRefToken::GetArrayLength() const
58 : {
59 0 : return mnArrayLength;
60 : }
61 :
62 0 : DoubleVectorRefToken::DoubleVectorRefToken(
63 : const std::vector<VectorRefArray>& rArrays, size_t nReqLength, size_t nArrayLength,
64 : size_t nRefRowSize, bool bStartFixed, bool bEndFixed ) :
65 : FormulaToken(svDoubleVectorRef, ocPush),
66 : maArrays(rArrays), mnRequestedLength(nReqLength), mnArrayLength(nArrayLength),
67 0 : mnRefRowSize(nRefRowSize), mbStartFixed(bStartFixed), mbEndFixed(bEndFixed) {}
68 :
69 0 : FormulaToken* DoubleVectorRefToken::Clone() const
70 : {
71 : return new DoubleVectorRefToken(
72 0 : maArrays, mnRequestedLength, mnArrayLength, mnRefRowSize, mbStartFixed, mbEndFixed);
73 : }
74 :
75 0 : const std::vector<VectorRefArray>& DoubleVectorRefToken::GetArrays() const
76 : {
77 0 : return maArrays;
78 : }
79 :
80 0 : size_t DoubleVectorRefToken::GetArrayLength() const
81 : {
82 0 : return mnArrayLength;
83 : }
84 :
85 0 : size_t DoubleVectorRefToken::GetRefRowSize() const
86 : {
87 0 : return mnRefRowSize;
88 : }
89 :
90 0 : bool DoubleVectorRefToken::IsStartFixed() const
91 : {
92 0 : return mbStartFixed;
93 : }
94 :
95 0 : bool DoubleVectorRefToken::IsEndFixed() const
96 : {
97 0 : return mbEndFixed;
98 : }
99 :
100 : }
101 :
102 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|