LibreOffice Module sc (master)  1
xipivot.hxx
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  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #pragma once
21 
22 #include "xlpivot.hxx"
23 #include "xiroot.hxx"
24 #include <vector>
25 #include <memory>
26 
27 class ScDPSaveData;
28 class ScDPSaveDimension;
29 
30 // Pivot cache
31 
33 class XclImpPCItem : public XclPCItem
34 {
35 public:
36  explicit XclImpPCItem( XclImpStream& rStrm );
37 
39  void WriteToSource( XclImpRoot& rRoot, const ScAddress& rScPos ) const;
40 
41 private:
43  void ReadSxdouble( XclImpStream& rStrm );
45  void ReadSxboolean( XclImpStream& rStrm );
47  void ReadSxerror( XclImpStream& rStrm );
49  void ReadSxinteger( XclImpStream& rStrm );
51  void ReadSxstring( XclImpStream& rStrm );
53  void ReadSxdatetime( XclImpStream& rStrm );
55  void ReadSxempty( XclImpStream& rStrm );
56 };
57 
58 typedef std::shared_ptr< XclImpPCItem > XclImpPCItemRef;
59 
60 struct ScDPNumGroupInfo;
61 class XclImpPivotCache;
62 
64 class XclImpPCField : public XclPCField, protected XclImpRoot
65 {
66 public:
68  explicit XclImpPCField( const XclImpRoot& rRoot,
69  XclImpPivotCache& rPCache, sal_uInt16 nFieldIdx );
70  virtual ~XclImpPCField() override;
71 
72  // general field/item access ----------------------------------------------
73 
75  const OUString& GetFieldName( const ScfStringVec& rVisNames ) const;
76 
78  const XclImpPCField* GetGroupBaseField() const;
79 
81  const XclImpPCItem* GetItem( sal_uInt16 nItemIdx ) const;
84  const XclImpPCItem* GetLimitItem( sal_uInt16 nItemIdx ) const;
85 
87  void WriteFieldNameToSource( SCCOL nScCol, SCTAB nScTab );
89  void WriteOrigItemToSource( SCROW nScRow, SCTAB nScTab, sal_uInt16 nItemIdx );
91  void WriteLastOrigItemToSource( SCROW nScRow, SCTAB nScTab );
92 
93  // records ----------------------------------------------------------------
94 
98  void ReadItem( XclImpStream& rStrm );
100  void ReadSxnumgroup( XclImpStream& rStrm );
102  void ReadSxgroupinfo( XclImpStream& rStrm );
103 
104  // grouping ---------------------------------------------------------------
105 
107  void ConvertGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
108 
109 private:
111  void ConvertStdGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
113  void ConvertNumGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
115  void ConvertDateGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
116 
121 
123  const double* GetNumGroupLimit( sal_uInt16 nLimitIdx ) const;
125  const DateTime* GetDateGroupLimit( sal_uInt16 nLimitIdx ) const;
127  const sal_Int16* GetDateGroupStep() const;
128 
129 private:
130  typedef ::std::vector< XclImpPCItemRef > XclImpPCItemVec;
131 
133  XclImpPCItemVec maItems;
134  XclImpPCItemVec maOrigItems;
135  XclImpPCItemVec maNumGroupItems;
138 };
139 
140 typedef std::shared_ptr< XclImpPCField > XclImpPCFieldRef;
141 
142 class XclImpPivotCache : protected XclImpRoot
143 {
144 public:
145  explicit XclImpPivotCache( const XclImpRoot& rRoot );
146  virtual ~XclImpPivotCache() override;
147 
148  // data access ------------------------------------------------------------
149 
151  const ScRange& GetSourceRange() const { return maSrcRange; }
152 
153  const OUString& GetSourceRangeName() const { return maSrcRangeName; }
154 
156  const XclImpPCField* GetField( sal_uInt16 nFieldIdx ) const;
157 
158  // records ----------------------------------------------------------------
159 
161  void ReadSxidstm( XclImpStream& rStrm );
163  void ReadSxvs( XclImpStream& rStrm );
165  void ReadDconref( XclImpStream& rStrm );
170  void ReadDConName( XclImpStream& rStrm );
172  void ReadPivotCacheStream( const XclImpStream& rStrm );
173 
174  bool IsRefreshOnLoad() const;
175  bool IsValid() const;
176 
177 private:
178  typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec;
179 
181  XclImpPCFieldVec maFields;
183  OUString maUrl;
184  OUString maTabName;
185  OUString maSrcRangeName;
186  sal_uInt16 mnStrmId;
187  sal_uInt16 mnSrcType;
188  bool mbSelfRef;
189 };
190 
191 typedef std::shared_ptr< XclImpPivotCache > XclImpPivotCacheRef;
192 
193 // Pivot table
194 
195 class XclImpPivotTable;
196 
198 {
199 public:
200  explicit XclImpPTItem( const XclImpPCField* pCacheField );
201 
203  const OUString* GetItemName() const;
205  std::pair<bool, OUString> GetItemName(const ScDPSaveDimension& rSaveDim, ScDPObject* pObj, const XclImpRoot& rRoot) const;
206 
208  void ReadSxvi( XclImpStream& rStrm );
209 
211  void ConvertItem( ScDPSaveDimension& rSaveDim, ScDPObject* pObj, const XclImpRoot& rRoot ) const;
212 
213 private:
216 };
217 
218 typedef std::shared_ptr< XclImpPTItem > XclImpPTItemRef;
219 
221 {
222 public:
223  explicit XclImpPTField( const XclImpPivotTable& rPTable, sal_uInt16 nCacheIdx );
224 
225  // general field/item access ----------------------------------------------
226 
228  const XclImpPCField* GetCacheField() const;
230  OUString GetFieldName() const;
232  OUString GetVisFieldName() const;
233 
235  const XclImpPTItem* GetItem( sal_uInt16 nItemIdx ) const;
237  const OUString* GetItemName( sal_uInt16 nItemIdx ) const;
238 
240  sal_uInt16 GetAxes() const { return maFieldInfo.mnAxes; }
242  void SetAxes( sal_uInt16 nAxes ) { maFieldInfo.mnAxes = nAxes; }
243 
244  // records ----------------------------------------------------------------
245 
247  void ReadSxvd( XclImpStream& rStrm );
249  void ReadSxvdex( XclImpStream& rStrm );
251  void ReadSxvi( XclImpStream& rStrm );
252 
253  // row/column fields ------------------------------------------------------
254 
255  void ConvertRowColField( ScDPSaveData& rSaveData ) const;
256 
257  // page fields ------------------------------------------------------------
258 
259  void SetPageFieldInfo( const XclPTPageFieldInfo& rPageInfo );
260  void ConvertPageField( ScDPSaveData& rSaveData ) const;
261 
262  // hidden fields ----------------------------------------------------------
263 
264  void ConvertHiddenField( ScDPSaveData& rSaveData ) const;
265 
266  // data fields ------------------------------------------------------------
267 
268  bool HasDataFieldInfo() const;
269  void AddDataFieldInfo( const XclPTDataFieldInfo& rDataInfo );
270  void ConvertDataField( ScDPSaveData& rSaveData ) const;
271 
272  void ConvertFieldInfo( const ScDPSaveData& rSaveData, ScDPObject* pObj, const XclImpRoot& rRoot, bool bPageField = false ) const;
273 
274 private:
275  void ConvertRCPField( ScDPSaveData& rSaveData ) const;
276 
277  void ConvertDataField( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const;
278  void ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const;
279 
280 private:
281 
286  std::vector< XclPTDataFieldInfo > maDataInfoVector;
287  std::vector< XclImpPTItemRef > maItems;
288 };
289 
290 typedef std::shared_ptr< XclImpPTField > XclImpPTFieldRef;
291 
292 class XclImpPivotTable : protected XclImpRoot
293 {
294 public:
295  explicit XclImpPivotTable( const XclImpRoot& rRoot );
296  virtual ~XclImpPivotTable() override;
297 
298  // cache/field access, misc. ----------------------------------------------
299 
300  const XclImpPivotCacheRef& GetPivotCache() const { return mxPCache; }
301  const ScfStringVec& GetVisFieldNames() const { return maVisFieldNames; }
302 
303  sal_uInt16 GetFieldCount() const;
304  const XclImpPTField* GetField( sal_uInt16 nFieldIdx ) const;
305  XclImpPTField* GetFieldAcc( sal_uInt16 nFieldIdx );
306 
307  const XclImpPTField* GetDataField( sal_uInt16 nDataFieldIdx ) const;
308  OUString GetDataFieldName( sal_uInt16 nDataFieldIdx ) const;
309 
310  // records ----------------------------------------------------------------
311 
313  void ReadSxview( XclImpStream& rStrm );
315  void ReadSxvd( XclImpStream& rStrm );
317  void ReadSxvi( XclImpStream& rStrm );
319  void ReadSxvdex( XclImpStream& rStrm );
321  void ReadSxivd( XclImpStream& rStrm );
323  void ReadSxpi( XclImpStream& rStrm );
325  void ReadSxdi( XclImpStream& rStrm );
327  void ReadSxex( XclImpStream& rStrm );
330  void ReadSxViewEx9( XclImpStream& rStrm );
331 
333  void ReadSxAddl( XclImpStream& rStrm );
334 
336  void Convert();
337 
338  void MaybeRefresh();
339 
340  void ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData);
341  void ApplyFieldInfo();
342 
343 private:
345 
350  std::vector< XclImpPTFieldRef >
362 };
363 
364 typedef std::shared_ptr< XclImpPivotTable > XclImpPivotTableRef;
365 
372 {
373 public:
374  explicit XclImpPivotTableManager( const XclImpRoot& rRoot );
375  virtual ~XclImpPivotTableManager() override;
376 
377  // pivot cache records ----------------------------------------------------
378 
380  XclImpPivotCacheRef GetPivotCache( sal_uInt16 nCacheIdx );
381 
383  void ReadSxidstm( XclImpStream& rStrm );
385  void ReadSxvs( XclImpStream& rStrm );
387  void ReadDconref( XclImpStream& rStrm );
388  void ReadDConName( XclImpStream& rStrm );
389 
390  // pivot table records ----------------------------------------------------
391 
393  void ReadSxview( XclImpStream& rStrm );
395  void ReadSxvd( XclImpStream& rStrm );
397  void ReadSxvdex( XclImpStream& rStrm );
399  void ReadSxivd( XclImpStream& rStrm );
401  void ReadSxpi( XclImpStream& rStrm );
403  void ReadSxdi( XclImpStream& rStrm );
405  void ReadSxvi( XclImpStream& rStrm );
407  void ReadSxex( XclImpStream& rStrm );
410  void ReadSxViewEx9( XclImpStream& rStrm );
412  void ReadSxAddl( XclImpStream& rStrm );
413 
415  void ReadPivotCaches( const XclImpStream& rStrm );
417  void ConvertPivotTables();
418 
420 
421 private:
422 
423  std::vector< XclImpPivotCacheRef > maPCaches;
424  std::vector< XclImpPivotTableRef > maPTables;
425 };
426 
427 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XclPTPageFieldInfo maPageInfo
Extended field info (SXVDEX record).
Definition: xipivot.hxx:285
OUString GetDataFieldName(sal_uInt16 nDataFieldIdx) const
Definition: xipivot.cxx:1279
std::vector< XclImpPTFieldRef > maFields
Definition: xipivot.hxx:351
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing a new field.
Definition: xipivot.cxx:1299
SCCOL mnSourceScCol
List of items containing numeric grouping limits.
Definition: xipivot.hxx:136
OUString maTabName
URL of the source data.
Definition: xipivot.hxx:184
void ReadSxidstm(XclImpStream &rStrm)
Reads an SXIDSTM record containing a pivot cache stream identifier and the pivot cache.
Definition: xipivot.cxx:611
void ReadPivotCacheStream(const XclImpStream &rStrm)
Reads the entire pivot cache stream.
Definition: xipivot.cxx:660
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of the current field.
Definition: xipivot.cxx:1695
Pivot table autoformat settings (SXVIEWEX9 record).
Definition: xlpivot.hxx:751
void ReadSxAddl(XclImpStream &rStrm)
Reads an SXADDL record that specifies additional info for pivot table.
Definition: xipivot.cxx:1405
void ConvertDateGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts date grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:448
void ReadSxpi(XclImpStream &rStrm)
Reads an SXPI record containing page field data.
Definition: xipivot.cxx:1683
XclPTViewEx9Info maPTViewEx9Info
Extended info about the pivot table (SXEX record).
Definition: xipivot.hxx:348
OUString GetFieldName() const
Returns the name of this field that is used to create the Calc dimensions.
Definition: xipivot.cxx:970
std::shared_ptr< XclImpPCItem > XclImpPCItemRef
Definition: xipivot.hxx:58
void ConvertPageField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1031
void ReadSxpi(XclImpStream &rStrm)
Reads an SXPI record containing page field data.
Definition: xipivot.cxx:1361
std::vector< XclImpPivotTableRef > maPTables
List of all pivot caches.
Definition: xipivot.hxx:424
void ReadSxfield(XclImpStream &rStrm)
Reads the SXFIELD record describing the field.
Definition: xipivot.cxx:246
void Convert()
Inserts the pivot table into the Calc document.
Definition: xipivot.cxx:1410
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of the current field.
Definition: xipivot.cxx:1323
const ScRange & GetSourceRange() const
Returns the data source range read from the DCONREF record.
Definition: xipivot.hxx:151
void ReadSxidstm(XclImpStream &rStrm)
Reads an SXIDSTM record containing a pivot cache stream identifier and the pivot cache.
Definition: xipivot.cxx:1631
void WriteLastOrigItemToSource(SCROW nScRow, SCTAB nScTab)
Inserts the data of the last inserted item into the document.
Definition: xipivot.cxx:238
Extended information about a pivot table (SXEX record).
Definition: xlpivot.hxx:734
ScfStringVec maVisFieldNames
Current field for importing additional info.
Definition: xipivot.hxx:353
XclPTFieldInfo maFieldInfo
Parent pivot table containing this field.
Definition: xipivot.hxx:283
const ScfStringVec & GetVisFieldNames() const
Definition: xipivot.hxx:301
XclImpPTField(const XclImpPivotTable &rPTable, sal_uInt16 nCacheIdx)
Definition: xipivot.cxx:956
OUString maSrcRangeName
Sheet name of the source data.
Definition: xipivot.hxx:185
XclPTFieldExtInfo maFieldExtInfo
General field info (SXVD record).
Definition: xipivot.hxx:284
XclImpPCItemVec maItems
Parent pivot cache containing this field.
Definition: xipivot.hxx:133
std::shared_ptr< XclImpPCField > XclImpPCFieldRef
Definition: xipivot.hxx:140
const sal_Int16 * GetDateGroupStep() const
Returns the step value for date grouping fields.
Definition: xipivot.cxx:566
void ReadSxAddl(XclImpStream &rStrm)
Reads an SXADDL record that specifies additional info for pivot table.
Definition: xipivot.cxx:1713
ScDPNumGroupInfo GetScDateGroupInfo() const
Returns a Calc struct with date grouping data.
Definition: xipivot.cxx:516
void ReadSxempty(XclImpStream &rStrm)
Reads an SXEMPTY record describing an empty item.
Definition: xipivot.cxx:175
XclImpPivotTable(const XclImpRoot &rRoot)
Definition: xipivot.cxx:1242
sal_uInt16 mnSrcType
Pivot cache stream identifier.
Definition: xipivot.hxx:187
Represents a field in a pivot cache.
Definition: xlpivot.hxx:476
void WriteFieldNameToSource(SCCOL nScCol, SCTAB nScTab)
Inserts the field name into the document.
Definition: xipivot.cxx:225
void ConvertDataField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1058
const XclImpPTItem * GetItem(sal_uInt16 nItemIdx) const
Returns the specified item.
Definition: xipivot.cxx:982
void ReadItem(XclImpStream &rStrm)
Reads an item data record describing a new item.
Definition: xipivot.cxx:344
XclImpPivotCacheRef mxPCache
Definition: xipivot.hxx:344
void ReadSxvs(XclImpStream &rStrm)
Reads an SXVS record containing the source type of a pivot cache.
Definition: xipivot.cxx:1638
void SetPageFieldInfo(const XclPTPageFieldInfo &rPageInfo)
Definition: xipivot.cxx:1026
virtual ~XclImpPivotCache() override
Definition: xipivot.cxx:598
void ConvertDataFieldInfo(ScDPSaveDimension &rSaveDim, const XclPTDataFieldInfo &rDataInfo) const
Definition: xipivot.cxx:1212
XclImpPCItem(XclImpStream &rStrm)
Definition: xipivot.cxx:68
const XclImpPivotCacheRef & GetPivotCache() const
Definition: xipivot.hxx:300
bool IsValid() const
Definition: xipivot.cxx:867
void ReadDconref(XclImpStream &rStrm)
Reads a DCONREF record containing the source range of a pivot cache.
Definition: xipivot.cxx:1644
XclImpPTField * GetFieldAcc(sal_uInt16 nFieldIdx)
Definition: xipivot.cxx:1266
Contains extended data for a pivot table field (SXVDEX record).
Definition: xlpivot.hxx:620
XclPTItemInfo maItemInfo
Definition: xipivot.hxx:214
void ReadSxdatetime(XclImpStream &rStrm)
Reads an SXDATETIME record describing a date/time item.
Definition: xipivot.cxx:161
std::shared_ptr< XclImpPivotTable > XclImpPivotTableRef
Definition: xipivot.hxx:364
bool IsRefreshOnLoad() const
Definition: xipivot.cxx:862
Contains data for a pivot table page field (part of SXPI record).
Definition: xlpivot.hxx:657
void ReadDConName(XclImpStream &rStrm)
Read DECONNAME record which contains the defined name of the source range.
Definition: xipivot.cxx:644
void ReadSxex(XclImpStream &rStrm)
Reads an SXEX record containing additional settings for a pivot table.
Definition: xipivot.cxx:1701
void ReadSxivd(XclImpStream &rStrm)
Reads an SXIVD record containing the row field or column field order.
Definition: xipivot.cxx:1329
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing the field.
Definition: xipivot.cxx:995
Contains data for a pivot table field (SXVD record).
Definition: xlpivot.hxx:591
XclImpPTItem(const XclImpPCField *pCacheField)
Definition: xipivot.cxx:877
void ReadSxgroupinfo(XclImpStream &rStrm)
Reads the SXGROUPINFO record describing the item order in grouping fields.
Definition: xipivot.cxx:378
ScDPNumGroupInfo GetScNumGroupInfo() const
Returns a Calc struct with numeric grouping data.
Definition: xipivot.cxx:492
void ReadSxboolean(XclImpStream &rStrm)
Reads an SXBOOLEAN record describing a boolean item.
Definition: xipivot.cxx:137
XclImpPivotCache & mrPCache
Definition: xipivot.hxx:132
ScfUInt16Vec maRowFields
Vector containing all visible field names.
Definition: xipivot.hxx:354
void ReadDConName(XclImpStream &rStrm)
Definition: xipivot.cxx:1650
ScRange maSrcRange
List of pivot cache fields.
Definition: xipivot.hxx:182
void ReadSxViewEx9(XclImpStream &rStrm)
Reads an SXVIEWEX9 record that specifies the pivot tables autoformat.
Definition: xipivot.cxx:1707
void ConvertStdGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts standard grouping information of this field into the passed ScDPSaveData. ...
Definition: xipivot.cxx:408
::std::vector< XclImpPCItemRef > XclImpPCItemVec
Definition: xipivot.hxx:130
ScfUInt16Vec maPageFields
Column field indexes.
Definition: xipivot.hxx:356
sal_Int16 SCCOL
Definition: types.hxx:21
XclImpPTField maDataOrientField
Filtered data field indexes.
Definition: xipivot.hxx:359
const XclImpPivotTable & mrPTable
Definition: xipivot.hxx:282
Represents a data item in a pivot cache.
Definition: xipivot.hxx:33
XclImpPivotTableManager(const XclImpRoot &rRoot)
Definition: xipivot.cxx:1612
void WriteOrigItemToSource(SCROW nScRow, SCTAB nScTab, sal_uInt16 nItemIdx)
Inserts the specified item data into the document.
Definition: xipivot.cxx:232
void ConvertPivotTables()
Inserts all pivot tables into the Calc document.
Definition: xipivot.cxx:1725
ScfUInt16Vec maColFields
Row field indexes.
Definition: xipivot.hxx:355
Contains data for a pivot table data item (SXVI record).
Definition: xlpivot.hxx:574
const XclImpPCItem * GetItem(sal_uInt16 nItemIdx) const
Returns the item at the specified position or 0 on error.
Definition: xipivot.cxx:213
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record containing data of this item.
Definition: xipivot.cxx:934
std::shared_ptr< XclImpPTField > XclImpPTFieldRef
Definition: xipivot.hxx:290
void ReadSxview(XclImpStream &rStrm)
Reads an SXVIEW record starting a new pivot table.
Definition: xipivot.cxx:1288
void ConvertRCPField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1112
void ConvertRowColField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1014
void ReadSxstring(XclImpStream &rStrm)
Reads an SXSTRING record describing a text item.
Definition: xipivot.cxx:155
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of the current field.
Definition: xipivot.cxx:1317
XclPTInfo maPTInfo
Pivot cache containing field/item names.
Definition: xipivot.hxx:346
const XclImpPCField * GetGroupBaseField() const
Returns the base field if this is a grouping field.
Definition: xipivot.cxx:207
Contains data for a pivot table data field (SXDI record).
Definition: xlpivot.hxx:672
bool mbSelfRef
Source data type.
Definition: xipivot.hxx:188
const XclImpPCField * GetField(sal_uInt16 nFieldIdx) const
Returns read-only access to a pivot cache field.
Definition: xipivot.cxx:604
void ConvertFieldInfo(const ScDPSaveData &rSaveData, ScDPObject *pObj, const XclImpRoot &rRoot, bool bPageField=false) const
Definition: xipivot.cxx:1174
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of a field.
Definition: xipivot.cxx:1671
void ReadSxvs(XclImpStream &rStrm)
Reads an SXVS record containing the source type of the pivot cache.
Definition: xipivot.cxx:616
OUString GetVisFieldName() const
Returns the internally set visible name of this field.
Definition: xipivot.cxx:976
const XclImpPCField * mpCacheField
General data for this item.
Definition: xipivot.hxx:215
void ApplyMergeFlags(const ScRange &rOutRange, const ScDPSaveData &rSaveData)
Definition: xipivot.cxx:1512
void ReadSxex(XclImpStream &rStrm)
Reads an SXEX record containing additional settings for the pivot table.
Definition: xipivot.cxx:1395
XclPCInfo maPCInfo
Definition: xipivot.hxx:180
virtual ~XclImpPivotTableManager() override
Definition: xipivot.cxx:1617
void ApplyFieldInfo()
Definition: xipivot.cxx:1585
void ReadSxViewEx9(XclImpStream &rStrm)
Reads an SXVIEWEX9 record that specifies the pivot tables autoformat.
Definition: xipivot.cxx:1400
XclImpPTFieldRef mxCurrField
Vector containing all fields.
Definition: xipivot.hxx:352
XclImpPivotCacheRef GetPivotCache(sal_uInt16 nCacheIdx)
Returns the pivot cache with the specified 0-based index.
Definition: xipivot.cxx:1623
std::shared_ptr< XclImpPivotCache > XclImpPivotCacheRef
Definition: xipivot.hxx:191
void ReadSxnumgroup(XclImpStream &rStrm)
Reads the SXNUMGROUP record describing numeric grouping fields.
Definition: xipivot.cxx:369
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of this field.
Definition: xipivot.cxx:1005
ScfUInt16Vec maOrigDataFields
Page field indexes.
Definition: xipivot.hxx:357
const XclImpPCField * GetCacheField() const
Returns the corresponding pivot cache field of this field.
Definition: xipivot.cxx:964
const DateTime * GetDateGroupLimit(sal_uInt16 nLimitIdx) const
Returns a limit value for date grouping fields (minimum/maximum only).
Definition: xipivot.cxx:555
std::vector< XclImpPivotCacheRef > maPCaches
Definition: xipivot.hxx:423
bool HasDataFieldInfo() const
Definition: xipivot.cxx:1047
XclPTAddl maPTAddlInfo
(SXVIEWEX9 record)
Definition: xipivot.hxx:349
XclImpPCFieldVec maFields
Pivot cache settings (SXDB record).
Definition: xipivot.hxx:181
sal_Int32 SCROW
Definition: types.hxx:17
void ReadSxdouble(XclImpStream &rStrm)
Reads an SXDOUBLE record describing a floating-point item.
Definition: xipivot.cxx:131
std::vector< XclPTDataFieldInfo > maDataInfoVector
Page field info (entry from SXPI record).
Definition: xipivot.hxx:286
XclPTExtInfo maPTExtInfo
General info about the pivot table (SXVIEW record).
Definition: xipivot.hxx:347
void ReadSxview(XclImpStream &rStrm)
Reads an SXVIEW record describing a new pivot table.
Definition: xipivot.cxx:1658
const double * GetNumGroupLimit(sal_uInt16 nLimitIdx) const
Returns a limit value for numeric grouping fields.
Definition: xipivot.cxx:544
::std::vector< sal_uInt16 > ScfUInt16Vec
Definition: ftools.hxx:255
const XclImpPCItem * GetLimitItem(sal_uInt16 nItemIdx) const
Returns the item representing a limit value in numeric/date/time grouping fields. ...
Definition: xipivot.cxx:218
Contains data for a pivot cache (SXDB record).
Definition: xlpivot.hxx:525
ScRange maOutScRange
Special data field orientation field.
Definition: xipivot.hxx:360
bool mbNumGroupInfoRead
Column index of source data for this field.
Definition: xipivot.hxx:137
void ConvertHiddenField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1039
sal_uInt16 GetAxes() const
Returns the flags of the axes this field is part of.
Definition: xipivot.hxx:240
void AddDataFieldInfo(const XclPTDataFieldInfo &rDataInfo)
Definition: xipivot.cxx:1052
void ReadSxinteger(XclImpStream &rStrm)
Reads an SXINTEGER record describing an integer item.
Definition: xipivot.cxx:149
void MaybeRefresh()
Definition: xipivot.cxx:1501
const OUString & GetSourceRangeName() const
Definition: xipivot.hxx:153
std::shared_ptr< XclImpPTItem > XclImpPTItemRef
Definition: xipivot.hxx:218
The main class for pivot table import.
Definition: xipivot.hxx:371
Contains data for a pivot table (SXVIEW record).
Definition: xlpivot.hxx:705
XclImpPCItemVec maOrigItems
List of all displayed data items.
Definition: xipivot.hxx:134
void ConvertItem(ScDPSaveDimension &rSaveDim, ScDPObject *pObj, const XclImpRoot &rRoot) const
Inserts this item into the passed ScDPSaveDimension.
Definition: xipivot.cxx:939
Additional pivot table settings (SXADDL record).
Definition: xlpivot.hxx:766
const XclImpPTField * GetDataField(sal_uInt16 nDataFieldIdx) const
Definition: xipivot.cxx:1272
void ReadSxivd(XclImpStream &rStrm)
Reads an SXIVD record containing the row field or column field order.
Definition: xipivot.cxx:1677
sal_uInt16 mnStrmId
Name of the source data range.
Definition: xipivot.hxx:186
virtual ~XclImpPCField() override
Definition: xipivot.cxx:190
void ConvertGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:393
void ConvertNumGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts numeric grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:441
void WriteToSource(XclImpRoot &rRoot, const ScAddress &rScPos) const
Inserts the item data into the passed document.
Definition: xipivot.cxx:96
void SetAxes(sal_uInt16 nAxes)
Sets the flags of the axes this field is part of.
Definition: xipivot.hxx:242
const XclImpPTField * GetField(sal_uInt16 nFieldIdx) const
Definition: xipivot.cxx:1260
ScfUInt16Vec maFiltDataFields
Original data field indexes.
Definition: xipivot.hxx:358
void ReadSxdi(XclImpStream &rStrm)
Reads an SXDI record containing data field data.
Definition: xipivot.cxx:1379
ScDPObject * mpDPObj
Output range in the Calc document.
Definition: xipivot.hxx:361
sal_uInt16 GetFieldCount() const
Definition: xipivot.cxx:1255
This class is used to import record oriented streams.
Definition: xistream.hxx:277
void ReadDconref(XclImpStream &rStrm)
Reads a DCONREF record containing the source range of the pivot cache.
Definition: xipivot.cxx:622
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing a new field.
Definition: xipivot.cxx:1665
XclImpPCField(const XclImpRoot &rRoot, XclImpPivotCache &rPCache, sal_uInt16 nFieldIdx)
Creates a pivot cache field by reading an SXFIELD record.
Definition: xipivot.cxx:181
void ReadPivotCaches(const XclImpStream &rStrm)
Reads all used pivot caches and creates additional sheets for external data sources.
Definition: xipivot.cxx:1719
virtual ~XclImpPivotTable() override
Definition: xipivot.cxx:1249
void SvStream & rStrm
Access to global data from other classes.
Definition: xiroot.hxx:125
const OUString & GetFieldName(const ScfStringVec &rVisNames) const
Returns the name of the field, uses the passed visible name if supported.
Definition: xipivot.cxx:196
::std::vector< OUString > ScfStringVec
Definition: ftools.hxx:258
void ReadSxdi(XclImpStream &rStrm)
Reads an SXDI record containing data field data.
Definition: xipivot.cxx:1689
std::vector< XclImpPTItemRef > maItems
Vector of extended data field info (SXDI records).
Definition: xipivot.hxx:287
XclImpPCItemVec maNumGroupItems
List of all source data items.
Definition: xipivot.hxx:135
const OUString * GetItemName() const
Returns the internal name of the item or 0, if no name could be found.
Definition: xipivot.cxx:882
XclImpPivotCache(const XclImpRoot &rRoot)
Definition: xipivot.cxx:589
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of the field.
Definition: xipivot.cxx:1000
sal_Int16 SCTAB
Definition: types.hxx:22
const OUString * GetItemName(sal_uInt16 nItemIdx) const
Returns the internal name of the specified item.
Definition: xipivot.cxx:987
sal_uInt16 mnAxes
Definition: xlpivot.hxx:593
::std::vector< XclImpPCFieldRef > XclImpPCFieldVec
Definition: xipivot.hxx:178
void ReadSxerror(XclImpStream &rStrm)
Reads an SXERROR record describing an error code item.
Definition: xipivot.cxx:143
OUString maUrl
Source range in the spreadsheet.
Definition: xipivot.hxx:183
Represents a field in a pivot cache (a column of data items in the source area).
Definition: xipivot.hxx:64
Represents a data item of any type in a pivot cache.
Definition: xlpivot.hxx:366