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() : mpNumericArray(NULL), mpStringArray(NULL) {}
15 7 : VectorRefArray::VectorRefArray( const double* pArray ) : mpNumericArray(pArray), mpStringArray(NULL) {}
16 3 : VectorRefArray::VectorRefArray( rtl_uString** pArray ) : mpNumericArray(NULL), mpStringArray(pArray) {}
17 10 : VectorRefArray::VectorRefArray( const double* pNumArray, rtl_uString** pStrArray ) :
18 10 : mpNumericArray(pNumArray), mpStringArray(pStrArray) {}
19 :
20 16 : bool VectorRefArray::isValid() const
21 : {
22 16 : return mpNumericArray || mpStringArray;
23 : }
24 :
25 0 : SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray& rArray, size_t nReqLength, size_t nArrayLength ) :
26 0 : FormulaToken(svSingleVectorRef, ocPush), maArray(rArray), mnRequestedLength(nReqLength), mnArrayLength(nArrayLength) {}
27 :
28 0 : FormulaToken* SingleVectorRefToken::Clone() const
29 : {
30 0 : return new SingleVectorRefToken(maArray, mnRequestedLength, mnArrayLength);
31 : }
32 :
33 0 : DoubleVectorRefToken::DoubleVectorRefToken(
34 : const std::vector<VectorRefArray>& rArrays, size_t nReqLength, size_t nArrayLength,
35 : size_t nRefRowSize, bool bStartFixed, bool bEndFixed ) :
36 : FormulaToken(svDoubleVectorRef, ocPush),
37 : maArrays(rArrays), mnRequestedLength(nReqLength), mnArrayLength(nArrayLength),
38 0 : mnRefRowSize(nRefRowSize), mbStartFixed(bStartFixed), mbEndFixed(bEndFixed) {}
39 :
40 0 : FormulaToken* DoubleVectorRefToken::Clone() const
41 : {
42 : return new DoubleVectorRefToken(
43 0 : maArrays, mnRequestedLength, mnArrayLength, mnRefRowSize, mbStartFixed, mbEndFixed);
44 : }
45 :
46 : }
47 :
48 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|