LibreOffice Module formula (master) 1
vectortoken.cxx
Go to the documentation of this file.
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
11#include <sal/log.hxx>
12
13namespace formula {
14
16 mpNumericArray(nullptr),
17 mpStringArray(nullptr),
18 mbValid(true) {}
19
21 mpNumericArray(nullptr),
22 mpStringArray(nullptr),
23 mbValid(false) {}
24
25VectorRefArray::VectorRefArray( const double* pArray ) :
26 mpNumericArray(pArray),
27 mpStringArray(nullptr),
28 mbValid(true) {}
29
30VectorRefArray::VectorRefArray( rtl_uString** pArray ) :
31 mpNumericArray(nullptr),
32 mpStringArray(pArray),
33 mbValid(true) {}
34
35VectorRefArray::VectorRefArray( const double* pNumArray, rtl_uString** pStrArray ) :
36 mpNumericArray(pNumArray),
37 mpStringArray(pStrArray),
38 mbValid(true) {}
39
41{
42 return mbValid;
43}
44
45SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray& rArray, size_t nArrayLength ) :
46 FormulaToken(svSingleVectorRef, ocPush), maArray(rArray), mnArrayLength(nArrayLength)
47{
48 SAL_INFO("formula.core", "Created SingleVectorRefToken nArrayLength=" << nArrayLength);
49}
50
52{
54}
55
57{
58 return maArray;
59}
60
62{
63 return mnArrayLength;
64}
65
67 std::vector<VectorRefArray>&& rArrays, size_t nArrayLength,
68 size_t nRefRowSize, bool bStartFixed, bool bEndFixed ) :
70 maArrays(std::move(rArrays)), mnArrayLength(nArrayLength),
71 mnRefRowSize(nRefRowSize), mbStartFixed(bStartFixed), mbEndFixed(bEndFixed)
72{
73 SAL_INFO("formula.core", "Created DoubleVectorRefToken nArrayLength=" << nArrayLength);
74}
75
77{
78 return new DoubleVectorRefToken(
80}
81
82const std::vector<VectorRefArray>& DoubleVectorRefToken::GetArrays() const
83{
84 return maArrays;
85}
86
88{
89 return mnArrayLength;
90}
91
93{
94 return mnRefRowSize;
95}
96
98{
99 return mbStartFixed;
100}
101
103{
104 return mbEndFixed;
105}
106
107}
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const std::vector< VectorRefArray > & GetArrays() const
Definition: vectortoken.cxx:82
std::vector< VectorRefArray > maArrays
Definition: vectortoken.hxx:82
bool mbStartFixed
original reference row size.
Definition: vectortoken.hxx:89
virtual FormulaToken * Clone() const override
Definition: vectortoken.cxx:76
bool mbEndFixed
whether or not the start row position is absolute.
Definition: vectortoken.hxx:90
DoubleVectorRefToken(std::vector< VectorRefArray > &&rArrays, size_t nArrayLength, size_t nRefRowSize, bool bStartFixed, bool bEndFixed)
whether or not the end row position is absolute.
Definition: vectortoken.cxx:66
size_t mnRefRowSize
length of all arrays which does not include trailing empty region.
Definition: vectortoken.hxx:85
SingleVectorRefToken(const VectorRefArray &rArray, size_t nArrayLength)
Definition: vectortoken.cxx:45
const VectorRefArray & GetArray() const
Definition: vectortoken.cxx:56
virtual FormulaToken * Clone() const override
Definition: vectortoken.cxx:51
#define SAL_INFO(area, stream)
@ svDoubleVectorRef
Definition: token.hxx:77
@ svSingleVectorRef
Definition: token.hxx:76
@ ocPush
Definition: opcode.hxx:31
bool mbValid
Single unit of vector reference consists of two physical arrays.
Definition: vectortoken.hxx:41