1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include <formula/vectortoken.hxx>
11 #include <sal/log.hxx>
15 VectorRefArray::VectorRefArray() :
16 mpNumericArray(nullptr),
17 mpStringArray(nullptr),
20 VectorRefArray::VectorRefArray( InitInvalid
) :
21 mpNumericArray(nullptr),
22 mpStringArray(nullptr),
25 VectorRefArray::VectorRefArray( const double* pArray
) :
26 mpNumericArray(pArray
),
27 mpStringArray(nullptr),
30 VectorRefArray::VectorRefArray( rtl_uString
** pArray
) :
31 mpNumericArray(nullptr),
32 mpStringArray(pArray
),
35 VectorRefArray::VectorRefArray( const double* pNumArray
, rtl_uString
** pStrArray
) :
36 mpNumericArray(pNumArray
),
37 mpStringArray(pStrArray
),
40 bool VectorRefArray::isValid() const
45 SingleVectorRefToken::SingleVectorRefToken( const VectorRefArray
& rArray
, size_t nArrayLength
) :
46 FormulaToken(svSingleVectorRef
, ocPush
), maArray(rArray
), mnArrayLength(nArrayLength
)
48 SAL_INFO("formula.core", "Created SingleVectorRefToken nArrayLength=" << nArrayLength
);
51 FormulaToken
* SingleVectorRefToken::Clone() const
53 return new SingleVectorRefToken(maArray
, mnArrayLength
);
56 const VectorRefArray
& SingleVectorRefToken::GetArray() const
61 size_t SingleVectorRefToken::GetArrayLength() const
66 DoubleVectorRefToken::DoubleVectorRefToken(
67 std::vector
<VectorRefArray
>&& rArrays
, size_t nArrayLength
,
68 size_t nRefRowSize
, bool bStartFixed
, bool bEndFixed
) :
69 FormulaToken(svDoubleVectorRef
, ocPush
),
70 maArrays(std::move(rArrays
)), mnArrayLength(nArrayLength
),
71 mnRefRowSize(nRefRowSize
), mbStartFixed(bStartFixed
), mbEndFixed(bEndFixed
)
73 SAL_INFO("formula.core", "Created DoubleVectorRefToken nArrayLength=" << nArrayLength
);
76 FormulaToken
* DoubleVectorRefToken::Clone() const
78 return new DoubleVectorRefToken(
79 std::vector(maArrays
), mnArrayLength
, mnRefRowSize
, mbStartFixed
, mbEndFixed
);
82 const std::vector
<VectorRefArray
>& DoubleVectorRefToken::GetArrays() const
87 size_t DoubleVectorRefToken::GetArrayLength() const
92 size_t DoubleVectorRefToken::GetRefRowSize() const
97 bool DoubleVectorRefToken::IsStartFixed() const
102 bool DoubleVectorRefToken::IsEndFixed() const
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */