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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
32 ScDPName::ScDPName() : mnDupCount(0)
35 ScDPName::ScDPName(OUString aName
, OUString aLayoutName
, sal_uInt8 nDupCount
) :
36 maName(std::move(aName
)), maLayoutName(std::move(aLayoutName
)), mnDupCount(nDupCount
)
41 ScDPLabelData::Member::Member() :
46 OUString
const & ScDPLabelData::Member::getDisplayName() const
48 if (!maLayoutName
.isEmpty())
54 ScDPLabelData::ScDPLabelData() :
57 mnFuncMask(PivotFunc::NONE
),
64 mbRepeatItemLabels(false)
67 OUString
const & ScDPLabelData::getDisplayName() const
69 if (!maLayoutName
.isEmpty())
77 ScPivotField::ScPivotField(SCCOL nNewCol
) :
79 nFuncMask(PivotFunc::NONE
),
84 tools::Long
ScPivotField::getOriginalDim() const
86 return mnOriginalDim
>= 0 ? mnOriginalDim
: static_cast<tools::Long
>(nCol
);
91 ScPivotParam::ScPivotParam() :
92 nCol(0), nRow(0), nTab(0),
93 bIgnoreEmptyRows(false), bDetectCategories(false),
94 bMakeTotalCol(true), bMakeTotalRow(true)
97 ScPivotParam::ScPivotParam( const ScPivotParam
& r
)
98 : nCol( r
.nCol
), nRow( r
.nRow
), nTab( r
.nTab
),
99 maPageFields(r
.maPageFields
),
100 maColFields(r
.maColFields
),
101 maRowFields(r
.maRowFields
),
102 maDataFields(r
.maDataFields
),
103 bIgnoreEmptyRows(r
.bIgnoreEmptyRows
),
104 bDetectCategories(r
.bDetectCategories
),
105 bMakeTotalCol(r
.bMakeTotalCol
),
106 bMakeTotalRow(r
.bMakeTotalRow
)
108 SetLabelData(r
.maLabelArray
);
111 ScPivotParam::~ScPivotParam()
114 void ScPivotParam::SetLabelData(const ScDPLabelDataVector
& rVector
)
116 ScDPLabelDataVector aNewArray
;
117 aNewArray
.reserve(rVector
.size());
118 for (const auto& rxData
: rVector
)
120 aNewArray
.push_back(std::make_unique
<ScDPLabelData
>(*rxData
));
122 maLabelArray
.swap(aNewArray
);
125 ScPivotParam
& ScPivotParam::operator=( const ScPivotParam
& rPivotParam
)
127 nCol
= rPivotParam
.nCol
;
128 nRow
= rPivotParam
.nRow
;
129 nTab
= rPivotParam
.nTab
;
130 bIgnoreEmptyRows
= rPivotParam
.bIgnoreEmptyRows
;
131 bDetectCategories
= rPivotParam
.bDetectCategories
;
132 bMakeTotalCol
= rPivotParam
.bMakeTotalCol
;
133 bMakeTotalRow
= rPivotParam
.bMakeTotalRow
;
135 maPageFields
= rPivotParam
.maPageFields
;
136 maColFields
= rPivotParam
.maColFields
;
137 maRowFields
= rPivotParam
.maRowFields
;
138 maDataFields
= rPivotParam
.maDataFields
;
140 SetLabelData(rPivotParam
.maLabelArray
);
146 ScPivotFuncData::ScPivotFuncData( SCCOL nCol
, PivotFunc nFuncMask
) :
148 mnFuncMask(nFuncMask
),
153 #if DEBUG_PIVOT_TABLE
154 void ScPivotFuncData::Dump() const
156 cout
<< "ScPivotFuncData: (col=" << mnCol
<< ", original dim=" << mnOriginalDim
157 << ", func mask=" << static_cast<int>(mnFuncMask
) << ", duplicate count=" << static_cast<int>(mnDupCount
)
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */