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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XIPIVOT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XIPIVOT_HXX
22 
23 #include "xlpivot.hxx"
24 #include "xiroot.hxx"
25 #include <vector>
26 #include <memory>
27 
28 class ScDPSaveData;
29 class ScDPSaveDimension;
30 
31 // Pivot cache
32 
34 class XclImpPCItem : public XclPCItem
35 {
36 public:
37  explicit XclImpPCItem( XclImpStream& rStrm );
38 
40  void WriteToSource( XclImpRoot& rRoot, const ScAddress& rScPos ) const;
41 
42 private:
44  void ReadSxdouble( XclImpStream& rStrm );
46  void ReadSxboolean( XclImpStream& rStrm );
48  void ReadSxerror( XclImpStream& rStrm );
50  void ReadSxinteger( XclImpStream& rStrm );
52  void ReadSxstring( XclImpStream& rStrm );
54  void ReadSxdatetime( XclImpStream& rStrm );
56  void ReadSxempty( XclImpStream& rStrm );
57 };
58 
59 typedef std::shared_ptr< XclImpPCItem > XclImpPCItemRef;
60 
61 struct ScDPNumGroupInfo;
62 class XclImpPivotCache;
63 
65 class XclImpPCField : public XclPCField, protected XclImpRoot
66 {
67 public:
69  explicit XclImpPCField( const XclImpRoot& rRoot,
70  XclImpPivotCache& rPCache, sal_uInt16 nFieldIdx );
71  virtual ~XclImpPCField() override;
72 
73  // general field/item access ----------------------------------------------
74 
76  const OUString& GetFieldName( const ScfStringVec& rVisNames ) const;
77 
79  const XclImpPCField* GetGroupBaseField() const;
80 
82  const XclImpPCItem* GetItem( sal_uInt16 nItemIdx ) const;
85  const XclImpPCItem* GetLimitItem( sal_uInt16 nItemIdx ) const;
86 
88  void WriteFieldNameToSource( SCCOL nScCol, SCTAB nScTab );
90  void WriteOrigItemToSource( SCROW nScRow, SCTAB nScTab, sal_uInt16 nItemIdx );
92  void WriteLastOrigItemToSource( SCROW nScRow, SCTAB nScTab );
93 
94  // records ----------------------------------------------------------------
95 
99  void ReadItem( XclImpStream& rStrm );
101  void ReadSxnumgroup( XclImpStream& rStrm );
103  void ReadSxgroupinfo( XclImpStream& rStrm );
104 
105  // grouping ---------------------------------------------------------------
106 
108  void ConvertGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
109 
110 private:
112  void ConvertStdGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
114  void ConvertNumGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
116  void ConvertDateGroupField( ScDPSaveData& rSaveData, const ScfStringVec& rVisNames ) const;
117 
122 
124  const double* GetNumGroupLimit( sal_uInt16 nLimitIdx ) const;
126  const DateTime* GetDateGroupLimit( sal_uInt16 nLimitIdx ) const;
128  const sal_Int16* GetDateGroupStep() const;
129 
130 private:
131  typedef ::std::vector< XclImpPCItemRef > XclImpPCItemVec;
132 
134  XclImpPCItemVec maItems;
135  XclImpPCItemVec maOrigItems;
136  XclImpPCItemVec maNumGroupItems;
139 };
140 
141 typedef std::shared_ptr< XclImpPCField > XclImpPCFieldRef;
142 
143 class XclImpPivotCache : protected XclImpRoot
144 {
145 public:
146  explicit XclImpPivotCache( const XclImpRoot& rRoot );
147  virtual ~XclImpPivotCache() override;
148 
149  // data access ------------------------------------------------------------
150 
152  const ScRange& GetSourceRange() const { return maSrcRange; }
153 
154  const OUString& GetSourceRangeName() const { return maSrcRangeName; }
155 
157  const XclImpPCField* GetField( sal_uInt16 nFieldIdx ) const;
158 
159  // records ----------------------------------------------------------------
160 
162  void ReadSxidstm( XclImpStream& rStrm );
164  void ReadSxvs( XclImpStream& rStrm );
166  void ReadDconref( XclImpStream& rStrm );
171  void ReadDConName( XclImpStream& rStrm );
173  void ReadPivotCacheStream( const XclImpStream& rStrm );
174 
175  bool IsRefreshOnLoad() const;
176  bool IsValid() const;
177 
178 private:
179  typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec;
180 
182  XclImpPCFieldVec maFields;
184  OUString maUrl;
185  OUString maTabName;
186  OUString maSrcRangeName;
187  sal_uInt16 mnStrmId;
188  sal_uInt16 mnSrcType;
189  bool mbSelfRef;
190 };
191 
192 typedef std::shared_ptr< XclImpPivotCache > XclImpPivotCacheRef;
193 
194 // Pivot table
195 
196 class XclImpPivotTable;
197 
199 {
200 public:
201  explicit XclImpPTItem( const XclImpPCField* pCacheField );
202 
204  const OUString* GetItemName() const;
206  std::pair<bool, OUString> GetItemName(const ScDPSaveDimension& rSaveDim, ScDPObject* pObj, const XclImpRoot& rRoot) const;
207 
209  void ReadSxvi( XclImpStream& rStrm );
210 
212  void ConvertItem( ScDPSaveDimension& rSaveDim, ScDPObject* pObj, const XclImpRoot& rRoot ) const;
213 
214 private:
217 };
218 
219 typedef std::shared_ptr< XclImpPTItem > XclImpPTItemRef;
220 
222 {
223 public:
224  explicit XclImpPTField( const XclImpPivotTable& rPTable, sal_uInt16 nCacheIdx );
225 
226  // general field/item access ----------------------------------------------
227 
229  const XclImpPCField* GetCacheField() const;
231  OUString GetFieldName() const;
233  OUString GetVisFieldName() const;
234 
236  const XclImpPTItem* GetItem( sal_uInt16 nItemIdx ) const;
238  const OUString* GetItemName( sal_uInt16 nItemIdx ) const;
239 
241  sal_uInt16 GetAxes() const { return maFieldInfo.mnAxes; }
243  void SetAxes( sal_uInt16 nAxes ) { maFieldInfo.mnAxes = nAxes; }
244 
245  // records ----------------------------------------------------------------
246 
248  void ReadSxvd( XclImpStream& rStrm );
250  void ReadSxvdex( XclImpStream& rStrm );
252  void ReadSxvi( XclImpStream& rStrm );
253 
254  // row/column fields ------------------------------------------------------
255 
256  void ConvertRowColField( ScDPSaveData& rSaveData ) const;
257 
258  // page fields ------------------------------------------------------------
259 
260  void SetPageFieldInfo( const XclPTPageFieldInfo& rPageInfo );
261  void ConvertPageField( ScDPSaveData& rSaveData ) const;
262 
263  // hidden fields ----------------------------------------------------------
264 
265  void ConvertHiddenField( ScDPSaveData& rSaveData ) const;
266 
267  // data fields ------------------------------------------------------------
268 
269  bool HasDataFieldInfo() const;
270  void AddDataFieldInfo( const XclPTDataFieldInfo& rDataInfo );
271  void ConvertDataField( ScDPSaveData& rSaveData ) const;
272 
273  void ConvertFieldInfo( const ScDPSaveData& rSaveData, ScDPObject* pObj, const XclImpRoot& rRoot, bool bPageField = false ) const;
274 
275 private:
276  void ConvertRCPField( ScDPSaveData& rSaveData ) const;
277 
278  void ConvertDataField( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const;
279  void ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const XclPTDataFieldInfo& rDataInfo ) const;
280 
281 private:
282 
287  std::vector< XclPTDataFieldInfo > maDataInfoVector;
288  std::vector< XclImpPTItemRef > maItems;
289 };
290 
291 typedef std::shared_ptr< XclImpPTField > XclImpPTFieldRef;
292 
293 class XclImpPivotTable : protected XclImpRoot
294 {
295 public:
296  explicit XclImpPivotTable( const XclImpRoot& rRoot );
297  virtual ~XclImpPivotTable() override;
298 
299  // cache/field access, misc. ----------------------------------------------
300 
301  const XclImpPivotCacheRef& GetPivotCache() const { return mxPCache; }
302  const ScfStringVec& GetVisFieldNames() const { return maVisFieldNames; }
303 
304  sal_uInt16 GetFieldCount() const;
305  const XclImpPTField* GetField( sal_uInt16 nFieldIdx ) const;
306  XclImpPTField* GetFieldAcc( sal_uInt16 nFieldIdx );
307 
308  const XclImpPTField* GetDataField( sal_uInt16 nDataFieldIdx ) const;
309  OUString GetDataFieldName( sal_uInt16 nDataFieldIdx ) const;
310 
311  // records ----------------------------------------------------------------
312 
314  void ReadSxview( XclImpStream& rStrm );
316  void ReadSxvd( XclImpStream& rStrm );
318  void ReadSxvi( XclImpStream& rStrm );
320  void ReadSxvdex( XclImpStream& rStrm );
322  void ReadSxivd( XclImpStream& rStrm );
324  void ReadSxpi( XclImpStream& rStrm );
326  void ReadSxdi( XclImpStream& rStrm );
328  void ReadSxex( XclImpStream& rStrm );
331  void ReadSxViewEx9( XclImpStream& rStrm );
332 
334  void ReadSxAddl( XclImpStream& rStrm );
335 
337  void Convert();
338 
339  void MaybeRefresh();
340 
341  void ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData);
342  void ApplyFieldInfo();
343 
344 private:
346 
351  std::vector< XclImpPTFieldRef >
363 };
364 
365 typedef std::shared_ptr< XclImpPivotTable > XclImpPivotTableRef;
366 
373 {
374 public:
375  explicit XclImpPivotTableManager( const XclImpRoot& rRoot );
376  virtual ~XclImpPivotTableManager() override;
377 
378  // pivot cache records ----------------------------------------------------
379 
381  XclImpPivotCacheRef GetPivotCache( sal_uInt16 nCacheIdx );
382 
384  void ReadSxidstm( XclImpStream& rStrm );
386  void ReadSxvs( XclImpStream& rStrm );
388  void ReadDconref( XclImpStream& rStrm );
389  void ReadDConName( XclImpStream& rStrm );
390 
391  // pivot table records ----------------------------------------------------
392 
394  void ReadSxview( XclImpStream& rStrm );
396  void ReadSxvd( XclImpStream& rStrm );
398  void ReadSxvdex( XclImpStream& rStrm );
400  void ReadSxivd( XclImpStream& rStrm );
402  void ReadSxpi( XclImpStream& rStrm );
404  void ReadSxdi( XclImpStream& rStrm );
406  void ReadSxvi( XclImpStream& rStrm );
408  void ReadSxex( XclImpStream& rStrm );
411  void ReadSxViewEx9( XclImpStream& rStrm );
413  void ReadSxAddl( XclImpStream& rStrm );
414 
416  void ReadPivotCaches( const XclImpStream& rStrm );
418  void ConvertPivotTables();
419 
421 
422 private:
423 
424  std::vector< XclImpPivotCacheRef > maPCaches;
425  std::vector< XclImpPivotTableRef > maPTables;
426 };
427 
428 #endif
429 
430 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XclPTPageFieldInfo maPageInfo
Extended field info (SXVDEX record).
Definition: xipivot.hxx:286
OUString GetDataFieldName(sal_uInt16 nDataFieldIdx) const
Definition: xipivot.cxx:1278
std::vector< XclImpPTFieldRef > maFields
Definition: xipivot.hxx:352
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing a new field.
Definition: xipivot.cxx:1298
SCCOL mnSourceScCol
List of items containing numeric grouping limits.
Definition: xipivot.hxx:137
OUString maTabName
URL of the source data.
Definition: xipivot.hxx:185
void ReadSxidstm(XclImpStream &rStrm)
Reads an SXIDSTM record containing a pivot cache stream identifier and the pivot cache.
Definition: xipivot.cxx:610
void ReadPivotCacheStream(const XclImpStream &rStrm)
Reads the entire pivot cache stream.
Definition: xipivot.cxx:659
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of the current field.
Definition: xipivot.cxx:1694
Pivot table autoformat settings (SXVIEWEX9 record).
Definition: xlpivot.hxx:752
void ReadSxAddl(XclImpStream &rStrm)
Reads an SXADDL record that specifies additional info for pivot table.
Definition: xipivot.cxx:1404
void ConvertDateGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts date grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:447
void ReadSxpi(XclImpStream &rStrm)
Reads an SXPI record containing page field data.
Definition: xipivot.cxx:1682
XclPTViewEx9Info maPTViewEx9Info
Extended info about the pivot table (SXEX record).
Definition: xipivot.hxx:349
OUString GetFieldName() const
Returns the name of this field that is used to create the Calc dimensions.
Definition: xipivot.cxx:969
std::shared_ptr< XclImpPCItem > XclImpPCItemRef
Definition: xipivot.hxx:59
void ConvertPageField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1030
void ReadSxpi(XclImpStream &rStrm)
Reads an SXPI record containing page field data.
Definition: xipivot.cxx:1360
std::vector< XclImpPivotTableRef > maPTables
List of all pivot caches.
Definition: xipivot.hxx:425
void ReadSxfield(XclImpStream &rStrm)
Reads the SXFIELD record describing the field.
Definition: xipivot.cxx:245
void Convert()
Inserts the pivot table into the Calc document.
Definition: xipivot.cxx:1409
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of the current field.
Definition: xipivot.cxx:1322
const ScRange & GetSourceRange() const
Returns the data source range read from the DCONREF record.
Definition: xipivot.hxx:152
void ReadSxidstm(XclImpStream &rStrm)
Reads an SXIDSTM record containing a pivot cache stream identifier and the pivot cache.
Definition: xipivot.cxx:1630
void WriteLastOrigItemToSource(SCROW nScRow, SCTAB nScTab)
Inserts the data of the last inserted item into the document.
Definition: xipivot.cxx:237
Extended information about a pivot table (SXEX record).
Definition: xlpivot.hxx:735
ScfStringVec maVisFieldNames
Current field for importing additional info.
Definition: xipivot.hxx:354
XclPTFieldInfo maFieldInfo
Parent pivot table containing this field.
Definition: xipivot.hxx:284
const ScfStringVec & GetVisFieldNames() const
Definition: xipivot.hxx:302
XclImpPTField(const XclImpPivotTable &rPTable, sal_uInt16 nCacheIdx)
Definition: xipivot.cxx:955
OUString maSrcRangeName
Sheet name of the source data.
Definition: xipivot.hxx:186
XclPTFieldExtInfo maFieldExtInfo
General field info (SXVD record).
Definition: xipivot.hxx:285
XclImpPCItemVec maItems
Parent pivot cache containing this field.
Definition: xipivot.hxx:134
std::shared_ptr< XclImpPCField > XclImpPCFieldRef
Definition: xipivot.hxx:141
const sal_Int16 * GetDateGroupStep() const
Returns the step value for date grouping fields.
Definition: xipivot.cxx:565
void ReadSxAddl(XclImpStream &rStrm)
Reads an SXADDL record that specifies additional info for pivot table.
Definition: xipivot.cxx:1712
ScDPNumGroupInfo GetScDateGroupInfo() const
Returns a Calc struct with date grouping data.
Definition: xipivot.cxx:515
void ReadSxempty(XclImpStream &rStrm)
Reads an SXEMPTY record describing an empty item.
Definition: xipivot.cxx:174
XclImpPivotTable(const XclImpRoot &rRoot)
Definition: xipivot.cxx:1241
sal_uInt16 mnSrcType
Pivot cache stream identifier.
Definition: xipivot.hxx:188
Represents a field in a pivot cache.
Definition: xlpivot.hxx:477
void WriteFieldNameToSource(SCCOL nScCol, SCTAB nScTab)
Inserts the field name into the document.
Definition: xipivot.cxx:224
void ConvertDataField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1057
const XclImpPTItem * GetItem(sal_uInt16 nItemIdx) const
Returns the specified item.
Definition: xipivot.cxx:981
void ReadItem(XclImpStream &rStrm)
Reads an item data record describing a new item.
Definition: xipivot.cxx:343
XclImpPivotCacheRef mxPCache
Definition: xipivot.hxx:345
void ReadSxvs(XclImpStream &rStrm)
Reads an SXVS record containing the source type of a pivot cache.
Definition: xipivot.cxx:1637
void SetPageFieldInfo(const XclPTPageFieldInfo &rPageInfo)
Definition: xipivot.cxx:1025
virtual ~XclImpPivotCache() override
Definition: xipivot.cxx:597
void ConvertDataFieldInfo(ScDPSaveDimension &rSaveDim, const XclPTDataFieldInfo &rDataInfo) const
Definition: xipivot.cxx:1211
XclImpPCItem(XclImpStream &rStrm)
Definition: xipivot.cxx:67
const XclImpPivotCacheRef & GetPivotCache() const
Definition: xipivot.hxx:301
bool IsValid() const
Definition: xipivot.cxx:866
void ReadDconref(XclImpStream &rStrm)
Reads a DCONREF record containing the source range of a pivot cache.
Definition: xipivot.cxx:1643
XclImpPTField * GetFieldAcc(sal_uInt16 nFieldIdx)
Definition: xipivot.cxx:1265
Contains extended data for a pivot table field (SXVDEX record).
Definition: xlpivot.hxx:621
XclPTItemInfo maItemInfo
Definition: xipivot.hxx:215
void ReadSxdatetime(XclImpStream &rStrm)
Reads an SXDATETIME record describing a date/time item.
Definition: xipivot.cxx:160
std::shared_ptr< XclImpPivotTable > XclImpPivotTableRef
Definition: xipivot.hxx:365
bool IsRefreshOnLoad() const
Definition: xipivot.cxx:861
Contains data for a pivot table page field (part of SXPI record).
Definition: xlpivot.hxx:658
void ReadDConName(XclImpStream &rStrm)
Read DECONNAME record which contains the defined name of the source range.
Definition: xipivot.cxx:643
void ReadSxex(XclImpStream &rStrm)
Reads an SXEX record containing additional settings for a pivot table.
Definition: xipivot.cxx:1700
void ReadSxivd(XclImpStream &rStrm)
Reads an SXIVD record containing the row field or column field order.
Definition: xipivot.cxx:1328
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing the field.
Definition: xipivot.cxx:994
Contains data for a pivot table field (SXVD record).
Definition: xlpivot.hxx:592
XclImpPTItem(const XclImpPCField *pCacheField)
Definition: xipivot.cxx:876
void ReadSxgroupinfo(XclImpStream &rStrm)
Reads the SXGROUPINFO record describing the item order in grouping fields.
Definition: xipivot.cxx:377
ScDPNumGroupInfo GetScNumGroupInfo() const
Returns a Calc struct with numeric grouping data.
Definition: xipivot.cxx:491
void ReadSxboolean(XclImpStream &rStrm)
Reads an SXBOOLEAN record describing a boolean item.
Definition: xipivot.cxx:136
XclImpPivotCache & mrPCache
Definition: xipivot.hxx:133
ScfUInt16Vec maRowFields
Vector containing all visible field names.
Definition: xipivot.hxx:355
void ReadDConName(XclImpStream &rStrm)
Definition: xipivot.cxx:1649
ScRange maSrcRange
List of pivot cache fields.
Definition: xipivot.hxx:183
void ReadSxViewEx9(XclImpStream &rStrm)
Reads an SXVIEWEX9 record that specifies the pivot tables autoformat.
Definition: xipivot.cxx:1706
void ConvertStdGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts standard grouping information of this field into the passed ScDPSaveData. ...
Definition: xipivot.cxx:407
::std::vector< XclImpPCItemRef > XclImpPCItemVec
Definition: xipivot.hxx:131
ScfUInt16Vec maPageFields
Column field indexes.
Definition: xipivot.hxx:357
sal_Int16 SCCOL
Definition: types.hxx:22
XclImpPTField maDataOrientField
Filtered data field indexes.
Definition: xipivot.hxx:360
const XclImpPivotTable & mrPTable
Definition: xipivot.hxx:283
Represents a data item in a pivot cache.
Definition: xipivot.hxx:34
XclImpPivotTableManager(const XclImpRoot &rRoot)
Definition: xipivot.cxx:1611
void WriteOrigItemToSource(SCROW nScRow, SCTAB nScTab, sal_uInt16 nItemIdx)
Inserts the specified item data into the document.
Definition: xipivot.cxx:231
void ConvertPivotTables()
Inserts all pivot tables into the Calc document.
Definition: xipivot.cxx:1724
ScfUInt16Vec maColFields
Row field indexes.
Definition: xipivot.hxx:356
Contains data for a pivot table data item (SXVI record).
Definition: xlpivot.hxx:575
const XclImpPCItem * GetItem(sal_uInt16 nItemIdx) const
Returns the item at the specified position or 0 on error.
Definition: xipivot.cxx:212
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record containing data of this item.
Definition: xipivot.cxx:933
std::shared_ptr< XclImpPTField > XclImpPTFieldRef
Definition: xipivot.hxx:291
void ReadSxview(XclImpStream &rStrm)
Reads an SXVIEW record starting a new pivot table.
Definition: xipivot.cxx:1287
void ConvertRCPField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1111
void ConvertRowColField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1013
void ReadSxstring(XclImpStream &rStrm)
Reads an SXSTRING record describing a text item.
Definition: xipivot.cxx:154
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of the current field.
Definition: xipivot.cxx:1316
XclPTInfo maPTInfo
Pivot cache containing field/item names.
Definition: xipivot.hxx:347
const XclImpPCField * GetGroupBaseField() const
Returns the base field if this is a grouping field.
Definition: xipivot.cxx:206
Contains data for a pivot table data field (SXDI record).
Definition: xlpivot.hxx:673
bool mbSelfRef
Source data type.
Definition: xipivot.hxx:189
const XclImpPCField * GetField(sal_uInt16 nFieldIdx) const
Returns read-only access to a pivot cache field.
Definition: xipivot.cxx:603
void ConvertFieldInfo(const ScDPSaveData &rSaveData, ScDPObject *pObj, const XclImpRoot &rRoot, bool bPageField=false) const
Definition: xipivot.cxx:1173
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of a field.
Definition: xipivot.cxx:1670
void ReadSxvs(XclImpStream &rStrm)
Reads an SXVS record containing the source type of the pivot cache.
Definition: xipivot.cxx:615
OUString GetVisFieldName() const
Returns the internally set visible name of this field.
Definition: xipivot.cxx:975
const XclImpPCField * mpCacheField
General data for this item.
Definition: xipivot.hxx:216
void ApplyMergeFlags(const ScRange &rOutRange, const ScDPSaveData &rSaveData)
Definition: xipivot.cxx:1511
void ReadSxex(XclImpStream &rStrm)
Reads an SXEX record containing additional settings for the pivot table.
Definition: xipivot.cxx:1394
XclPCInfo maPCInfo
Definition: xipivot.hxx:181
virtual ~XclImpPivotTableManager() override
Definition: xipivot.cxx:1616
void ApplyFieldInfo()
Definition: xipivot.cxx:1584
void ReadSxViewEx9(XclImpStream &rStrm)
Reads an SXVIEWEX9 record that specifies the pivot tables autoformat.
Definition: xipivot.cxx:1399
XclImpPTFieldRef mxCurrField
Vector containing all fields.
Definition: xipivot.hxx:353
XclImpPivotCacheRef GetPivotCache(sal_uInt16 nCacheIdx)
Returns the pivot cache with the specified 0-based index.
Definition: xipivot.cxx:1622
std::shared_ptr< XclImpPivotCache > XclImpPivotCacheRef
Definition: xipivot.hxx:192
void ReadSxnumgroup(XclImpStream &rStrm)
Reads the SXNUMGROUP record describing numeric grouping fields.
Definition: xipivot.cxx:368
void ReadSxvi(XclImpStream &rStrm)
Reads an SXVI record describing a new item of this field.
Definition: xipivot.cxx:1004
ScfUInt16Vec maOrigDataFields
Page field indexes.
Definition: xipivot.hxx:358
const XclImpPCField * GetCacheField() const
Returns the corresponding pivot cache field of this field.
Definition: xipivot.cxx:963
const DateTime * GetDateGroupLimit(sal_uInt16 nLimitIdx) const
Returns a limit value for date grouping fields (minimum/maximum only).
Definition: xipivot.cxx:554
std::vector< XclImpPivotCacheRef > maPCaches
Definition: xipivot.hxx:424
bool HasDataFieldInfo() const
Definition: xipivot.cxx:1046
XclPTAddl maPTAddlInfo
(SXVIEWEX9 record)
Definition: xipivot.hxx:350
XclImpPCFieldVec maFields
Pivot cache settings (SXDB record).
Definition: xipivot.hxx:182
sal_Int32 SCROW
Definition: types.hxx:18
void ReadSxdouble(XclImpStream &rStrm)
Reads an SXDOUBLE record describing a floating-point item.
Definition: xipivot.cxx:130
std::vector< XclPTDataFieldInfo > maDataInfoVector
Page field info (entry from SXPI record).
Definition: xipivot.hxx:287
XclPTExtInfo maPTExtInfo
General info about the pivot table (SXVIEW record).
Definition: xipivot.hxx:348
void ReadSxview(XclImpStream &rStrm)
Reads an SXVIEW record describing a new pivot table.
Definition: xipivot.cxx:1657
const double * GetNumGroupLimit(sal_uInt16 nLimitIdx) const
Returns a limit value for numeric grouping fields.
Definition: xipivot.cxx:543
::std::vector< sal_uInt16 > ScfUInt16Vec
Definition: ftools.hxx:253
const XclImpPCItem * GetLimitItem(sal_uInt16 nItemIdx) const
Returns the item representing a limit value in numeric/date/time grouping fields. ...
Definition: xipivot.cxx:217
Contains data for a pivot cache (SXDB record).
Definition: xlpivot.hxx:526
ScRange maOutScRange
Special data field orientation field.
Definition: xipivot.hxx:361
bool mbNumGroupInfoRead
Column index of source data for this field.
Definition: xipivot.hxx:138
void ConvertHiddenField(ScDPSaveData &rSaveData) const
Definition: xipivot.cxx:1038
sal_uInt16 GetAxes() const
Returns the flags of the axes this field is part of.
Definition: xipivot.hxx:241
void AddDataFieldInfo(const XclPTDataFieldInfo &rDataInfo)
Definition: xipivot.cxx:1051
void ReadSxinteger(XclImpStream &rStrm)
Reads an SXINTEGER record describing an integer item.
Definition: xipivot.cxx:148
void MaybeRefresh()
Definition: xipivot.cxx:1500
const OUString & GetSourceRangeName() const
Definition: xipivot.hxx:154
std::shared_ptr< XclImpPTItem > XclImpPTItemRef
Definition: xipivot.hxx:219
The main class for pivot table import.
Definition: xipivot.hxx:372
Contains data for a pivot table (SXVIEW record).
Definition: xlpivot.hxx:706
XclImpPCItemVec maOrigItems
List of all displayed data items.
Definition: xipivot.hxx:135
void ConvertItem(ScDPSaveDimension &rSaveDim, ScDPObject *pObj, const XclImpRoot &rRoot) const
Inserts this item into the passed ScDPSaveDimension.
Definition: xipivot.cxx:938
Additional pivot table settings (SXADDL record).
Definition: xlpivot.hxx:767
const XclImpPTField * GetDataField(sal_uInt16 nDataFieldIdx) const
Definition: xipivot.cxx:1271
void ReadSxivd(XclImpStream &rStrm)
Reads an SXIVD record containing the row field or column field order.
Definition: xipivot.cxx:1676
sal_uInt16 mnStrmId
Name of the source data range.
Definition: xipivot.hxx:187
virtual ~XclImpPCField() override
Definition: xipivot.cxx:189
void ConvertGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:392
void ConvertNumGroupField(ScDPSaveData &rSaveData, const ScfStringVec &rVisNames) const
Inserts numeric grouping information of this field into the passed ScDPSaveData.
Definition: xipivot.cxx:440
void WriteToSource(XclImpRoot &rRoot, const ScAddress &rScPos) const
Inserts the item data into the passed document.
Definition: xipivot.cxx:95
void SetAxes(sal_uInt16 nAxes)
Sets the flags of the axes this field is part of.
Definition: xipivot.hxx:243
const XclImpPTField * GetField(sal_uInt16 nFieldIdx) const
Definition: xipivot.cxx:1259
ScfUInt16Vec maFiltDataFields
Original data field indexes.
Definition: xipivot.hxx:359
void ReadSxdi(XclImpStream &rStrm)
Reads an SXDI record containing data field data.
Definition: xipivot.cxx:1378
ScDPObject * mpDPObj
Output range in the Calc document.
Definition: xipivot.hxx:362
sal_uInt16 GetFieldCount() const
Definition: xipivot.cxx:1254
This class is used to import record oriented streams.
Definition: xistream.hxx:278
void ReadDconref(XclImpStream &rStrm)
Reads a DCONREF record containing the source range of the pivot cache.
Definition: xipivot.cxx:621
void ReadSxvd(XclImpStream &rStrm)
Reads an SXVD record describing a new field.
Definition: xipivot.cxx:1664
XclImpPCField(const XclImpRoot &rRoot, XclImpPivotCache &rPCache, sal_uInt16 nFieldIdx)
Creates a pivot cache field by reading an SXFIELD record.
Definition: xipivot.cxx:180
void ReadPivotCaches(const XclImpStream &rStrm)
Reads all used pivot caches and creates additional sheets for external data sources.
Definition: xipivot.cxx:1718
virtual ~XclImpPivotTable() override
Definition: xipivot.cxx:1248
void SvStream & rStrm
Access to global data from other classes.
Definition: xiroot.hxx:126
const OUString & GetFieldName(const ScfStringVec &rVisNames) const
Returns the name of the field, uses the passed visible name if supported.
Definition: xipivot.cxx:195
::std::vector< OUString > ScfStringVec
Definition: ftools.hxx:256
void ReadSxdi(XclImpStream &rStrm)
Reads an SXDI record containing data field data.
Definition: xipivot.cxx:1688
std::vector< XclImpPTItemRef > maItems
Vector of extended data field info (SXDI records).
Definition: xipivot.hxx:288
XclImpPCItemVec maNumGroupItems
List of all source data items.
Definition: xipivot.hxx:136
const OUString * GetItemName() const
Returns the internal name of the item or 0, if no name could be found.
Definition: xipivot.cxx:881
XclImpPivotCache(const XclImpRoot &rRoot)
Definition: xipivot.cxx:588
void ReadSxvdex(XclImpStream &rStrm)
Reads an SXVDEX record describing extended options of the field.
Definition: xipivot.cxx:999
sal_Int16 SCTAB
Definition: types.hxx:23
const OUString * GetItemName(sal_uInt16 nItemIdx) const
Returns the internal name of the specified item.
Definition: xipivot.cxx:986
sal_uInt16 mnAxes
Definition: xlpivot.hxx:594
::std::vector< XclImpPCFieldRef > XclImpPCFieldVec
Definition: xipivot.hxx:179
void ReadSxerror(XclImpStream &rStrm)
Reads an SXERROR record describing an error code item.
Definition: xipivot.cxx:142
OUString maUrl
Source range in the spreadsheet.
Definition: xipivot.hxx:184
Represents a field in a pivot cache (a column of data items in the source area).
Definition: xipivot.hxx:65
Represents a data item of any type in a pivot cache.
Definition: xlpivot.hxx:367