tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / formula / source / core / api / vectortoken.cxx
blobc1bd521577956f4d68b59f1351710a7dda9b5e0f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include <formula/vectortoken.hxx>
11 #include <sal/log.hxx>
13 namespace formula {
15 VectorRefArray::VectorRefArray() :
16 mpNumericArray(nullptr),
17 mpStringArray(nullptr),
18 mbValid(true) {}
20 VectorRefArray::VectorRefArray( InitInvalid ) :
21 mpNumericArray(nullptr),
22 mpStringArray(nullptr),
23 mbValid(false) {}
25 VectorRefArray::VectorRefArray( const double* pArray ) :
26 mpNumericArray(pArray),
27 mpStringArray(nullptr),
28 mbValid(true) {}
30 VectorRefArray::VectorRefArray( rtl_uString** pArray ) :
31 mpNumericArray(nullptr),
32 mpStringArray(pArray),
33 mbValid(true) {}
35 VectorRefArray::VectorRefArray( const double* pNumArray, rtl_uString** pStrArray ) :
36 mpNumericArray(pNumArray),
37 mpStringArray(pStrArray),
38 mbValid(true) {}
40 bool VectorRefArray::isValid() const
42 return mbValid;
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
58 return maArray;
61 size_t SingleVectorRefToken::GetArrayLength() const
63 return mnArrayLength;
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
84 return maArrays;
87 size_t DoubleVectorRefToken::GetArrayLength() const
89 return mnArrayLength;
92 size_t DoubleVectorRefToken::GetRefRowSize() const
94 return mnRefRowSize;
97 bool DoubleVectorRefToken::IsStartFixed() const
99 return mbStartFixed;
102 bool DoubleVectorRefToken::IsEndFixed() const
104 return mbEndFixed;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */