LibreOffice Module sc (master)  1
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
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 .
18  */
23 #include "xerecord.hxx"
24 #include "xlpivot.hxx"
25 #include "xeroot.hxx"
27 class ScDPObject;
28 class ScDPSaveData;
29 class ScDPSaveDimension;
30 class ScDPSaveMember;
32 struct ScDPNumGroupInfo;
34 // Pivot cache
37 class XclExpPCItem : public XclExpRecord, public XclPCItem
38 {
39 public:
40  explicit XclExpPCItem( const OUString& rText );
41  explicit XclExpPCItem( double fValue, const OUString& rText = OUString() );
42  explicit XclExpPCItem( const DateTime& rDateTime, const OUString& rText = OUString() );
43  explicit XclExpPCItem( sal_Int16 nValue );
44  explicit XclExpPCItem( bool bValue, const OUString& rText );
46  sal_uInt16 GetTypeFlag() const { return mnTypeFlag; }
48  bool EqualsText( std::u16string_view rText ) const;
49  bool EqualsDouble( double fValue ) const;
50  bool EqualsDateTime( const DateTime& rDateTime ) const;
51  bool EqualsBool( bool bValue ) const;
53 private:
54  virtual void WriteBody( XclExpStream& rStrm ) override;
56 private:
57  sal_uInt16 mnTypeFlag;
58 };
60 class XclExpPCField : public XclExpRecord, public XclPCField, protected XclExpRoot
61 {
62 public:
64  explicit XclExpPCField( const XclExpRoot& rRoot,
65  sal_uInt16 nFieldIdx,
66  const ScDPObject& rDPObj, const ScRange& rRange );
68  explicit XclExpPCField( const XclExpRoot& rRoot,
69  sal_uInt16 nFieldIdx,
70  const ScDPObject& rDPObj, const ScDPSaveGroupDimension& rGroupDim,
71  const XclExpPCField& rBaseField );
72  virtual ~XclExpPCField() override;
75  void SetGroupChildField( const XclExpPCField& rChildField );
78  const OUString& GetFieldName() const { return maFieldInfo.maName; }
81  sal_uInt16 GetItemCount() const;
83  const XclExpPCItem* GetItem( sal_uInt16 nItemIdx ) const;
85  sal_uInt16 GetItemIndex( std::u16string_view rItemName ) const;
88  std::size_t GetIndexSize() const;
90  void WriteIndex( XclExpStream& rStrm, sal_uInt32 nSrcRow ) const;
93  virtual void Save( XclExpStream& rStrm ) override;
95 private:
101  const XclExpPCItemList& GetVisItemList() const;
104  void InitStandardField( const ScRange& rRange );
106  void InitStdGroupField( const XclExpPCField& rBaseField, const ScDPSaveGroupDimension& rGroupDim );
108  void InitNumGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo );
110  void InitDateGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nDatePart );
113  void InsertItemArrayIndex( size_t nListPos );
115  void InsertOrigItem( XclExpPCItem* pNewItem );
117  void InsertOrigTextItem( const OUString& rText );
119  void InsertOrigDoubleItem( double fValue, const OUString& rText );
121  void InsertOrigDateTimeItem( const DateTime& rDateTime, const OUString& rText );
123  void InsertOrigBoolItem( bool bValue, const OUString& rText );
127  sal_uInt16 InsertGroupItem( XclExpPCItem* pNewItem );
129  void InsertNumDateGroupItems( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo, sal_Int32 nDatePart = 0 );
132  void SetNumGroupLimit( const ScDPNumGroupInfo& rNumInfo );
135  void SetDateGroupLimit( const ScDPNumGroupInfo& rDateInfo, bool bUseStep );
138  void Finalize();
141  void WriteSxnumgroup( XclExpStream& rStrm );
143  void WriteSxgroupinfo( XclExpStream& rStrm );
146  virtual void WriteBody( XclExpStream& rStrm ) override;
148 private:
149  XclExpPCItemList maOrigItemList;
150  XclExpPCItemList maGroupItemList;
152  XclExpPCItemList maNumGroupLimits;
153  sal_uInt16 mnTypeFlags;
154 };
157 {
158 public:
159  explicit XclExpPivotCache( const XclExpRoot& rRoot,
160  const ScDPObject& rDPObj, sal_uInt16 nListIdx );
163  bool IsValid() const { return mbValid; }
165  bool HasItemIndexList() const;
168  sal_uInt16 GetCacheIndex() const { return mnListIdx; }
171  sal_uInt16 GetFieldCount() const;
173  const XclExpPCField* GetField( sal_uInt16 nFieldIdx ) const;
175  bool HasAddFields() const;
178  bool HasEqualDataSource( const ScDPObject& rDPObj ) const;
181  void Save( XclExpStream& rStrm );
182  static void SaveXml( XclExpXmlStream& rStrm );
184 private:
186  void AddFields( const ScDPObject& rDPObj );
189  void AddStdFields( const ScDPObject& rDPObj );
191  void AddGroupFields( const ScDPObject& rDPObj );
194  void WriteDconref( XclExpStream& rStrm ) const;
196  void WriteDConName( XclExpStream& rStrm ) const;
199  void WriteCacheStream();
201  void WriteSxdb( XclExpStream& rStrm ) const;
203  static void WriteSxdbex( XclExpStream& rStrm );
205  void WriteSxindexlistList( XclExpStream& rStrm ) const;
207 private:
212  XclExpPCFieldList maFieldList;
213  OUString maTabName;
214  OUString maSrcRangeName;
218  sal_uInt16 mnListIdx;
219  bool mbValid;
220 };
224 // Pivot table
229 typedef ::std::pair< sal_uInt16, sal_uInt16 > XclPTDataFieldPos;
232 {
233 public:
234  explicit XclExpPTItem( const XclExpPCField& rCacheField, sal_uInt16 nCacheIdx );
235  explicit XclExpPTItem( sal_uInt16 nItemType, sal_uInt16 nCacheIdx );
238  OUString GetItemName() const;
241  void SetPropertiesFromMember( const ScDPSaveMember& rSaveMem );
243 private:
245  virtual void WriteBody( XclExpStream& rStrm ) override;
247 private:
250 };
253 {
254 public:
255  explicit XclExpPTField( const XclExpPivotTable& rPTable, sal_uInt16 nCacheIdx );
257  // data access ------------------------------------------------------------
260  OUString GetFieldName() const;
264  sal_uInt16 GetFieldIndex() const { return maFieldInfo.mnCacheIdx; }
267  sal_uInt16 GetLastDataInfoIndex() const;
271  sal_uInt16 GetItemIndex( std::u16string_view rName, sal_uInt16 nDefaultIdx ) const;
273  // fill data --------------------------------------------------------------
276  void SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
278  void SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
281  void AppendSubtotalItems();
283  // records ----------------------------------------------------------------
286  void WriteSxpiEntry( XclExpStream& rStrm ) const;
288  void WriteSxdi( XclExpStream& rStrm, sal_uInt16 nDataInfoIdx ) const;
291  virtual void Save( XclExpStream& rStrm ) override;
293 private:
295  XclExpPTItem* GetItemAcc( std::u16string_view rName );
298  void AppendSubtotalItem( sal_uInt16 nItemType );
301  void WriteSxvd( XclExpStream& rStrm ) const;
303  void WriteSxvdex( XclExpStream& rStrm ) const;
305 private:
312  std::vector< XclPTDataFieldInfo >
316 };
319 {
320 public:
321  explicit XclExpPivotTable( const XclExpRoot& rRoot,
322  const ScDPObject& rDPObj, const XclExpPivotCache& rPCache );
325  const XclExpPCField* GetCacheField( sal_uInt16 nCacheIdx ) const;
328  SCTAB GetScTab() const { return mnOutScTab; }
331  const XclExpPTField* GetField( sal_uInt16 nFieldIdx ) const;
333  const XclExpPTField* GetField( std::u16string_view rName ) const;
337  sal_uInt16 GetDataFieldIndex( const OUString& rName, sal_uInt16 nDefaultIdx ) const;
340  virtual void Save( XclExpStream& rStrm ) override;
342 private:
344  XclExpPTField* GetFieldAcc( std::u16string_view rName );
346  XclExpPTField* GetFieldAcc( const ScDPSaveDimension& rSaveDim );
348  // fill data --------------------------------------------------------------
351  void SetPropertiesFromDP( const ScDPSaveData& rSaveData );
353  void SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
355  void SetDataFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
358  void Finalize();
360  // records ----------------------------------------------------------------
363  void WriteSxview( XclExpStream& rStrm ) const;
365  static void WriteSxivd( XclExpStream& rStrm, const ScfUInt16Vec& rFields );
367  void WriteSxpi( XclExpStream& rStrm ) const;
369  void WriteSxdiList( XclExpStream& rStrm ) const;
371  static void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount );
373  void WriteSxex( XclExpStream& rStrm ) const;
375  void WriteQsiSxTag( XclExpStream& rStrm ) const;
377  void WriteSxViewEx9( XclExpStream& rStrm ) const;
379 private:
387  XclExpPTFieldList maFieldList;
391  std::vector< XclPTDataFieldPos >
395  bool mbValid;
396  bool mbFilterBtn;
397 };
407 {
408 public:
409  explicit XclExpPivotTableManager( const XclExpRoot& rRoot );
412  void CreatePivotTables();
422  void WritePivotTables( XclExpStream& rStrm, SCTAB nScTab );
424 private:
427  const XclExpPivotCache* CreatePivotCache( const ScDPObject& rDPObj );
429 private:
434  XclExpPivotTableList maPTableList;
435 };
437 #endif
439 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const XclExpPCField * mpCacheField
Parent pivot table containing this field.
Definition: xepivot.hxx:308
void AppendSubtotalItems()
Appends special items describing the field subtotal entries.
Definition: xepivot.cxx:1102
void InsertItemArrayIndex(size_t nListPos)
Inserts the passed index into the item index array of original items.
Definition: xepivot.cxx:443
sal_uInt16 GetItemCount() const
Returns the number of visible items of this field.
Definition: xepivot.cxx:262
void SetPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with row/column/page properties from the passed save dimension.
Definition: xepivot.cxx:1000
std::vector< XclPTDataFieldInfo > maDataInfoVec
Page field info (entry in SXPI record).
Definition: xepivot.hxx:313
ScRange maExpSrcRange
The original sheet source range.
Definition: xepivot.hxx:216
XclExpPTField maDataOrientField
Data field indexes.
Definition: xepivot.hxx:393
bool HasAddFields() const
Returns true, if this pivot cache contains non-standard fields (e.g.
Definition: xepivot.cxx:693
bool HasEqualDataSource(const ScDPObject &rDPObj) const
Returns true, if the passed DP object has the same data source as this cache.
Definition: xepivot.cxx:699
void WriteSxdiList(XclExpStream &rStrm) const
Writes all SXDI records containing info about the data fields.
Definition: xepivot.cxx:1486
XclExpPCItem(const OUString &rText)
Definition: xepivot.cxx:95
void SetGroupChildField(const XclExpPCField &rChildField)
Sets the passed field as direct grouping child field of this field.
Definition: xepivot.cxx:254
virtual void Save(XclExpStream &rStrm) override
Writes the pivot cache field and all items and other related records.
Definition: xepivot.cxx:299
Pivot table autoformat settings (SXVIEWEX9 record).
Definition: xlpivot.hxx:752
XclPTExtInfo maPTExtInfo
Info about the pivot table (SXVIEW record).
Definition: xepivot.hxx:385
This class is used to export Excel record streams.
Definition: xestream.hxx:73
sal_uInt16 mnListIdx
The range used to build the cache fields and items.
Definition: xepivot.hxx:218
void SetFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table field with all properties from the passed save dimension.
Definition: xepivot.cxx:1324
ScfUInt16Vec maIndexVec
List with grouping items.
Definition: xepivot.hxx:151
XclExpPivotTableList::RecordRefType XclExpPivotTableRef
Definition: xepivot.hxx:431
sal_uInt16 mnCacheIdx
Number of items of this field.
Definition: xlpivot.hxx:598
Extended information about a pivot table (SXEX record).
Definition: xlpivot.hxx:735
bool IsValid() const
Returns true, if the cache has been constructed successfully.
Definition: xepivot.hxx:163
void WriteSxpi(XclExpStream &rStrm) const
Writes the SXPI record containing page field info.
Definition: xepivot.cxx:1470
void CreatePivotTables()
Creates all pivot tables and caches from the Calc DataPilot objects.
Definition: xepivot.cxx:1629
XclExpPivotTable(const XclExpRoot &rRoot, const ScDPObject &rDPObj, const XclExpPivotCache &rPCache)
Definition: xepivot.cxx:1177
std::size_t GetIndexSize() const
Returns the size an item index needs to write out.
Definition: xepivot.cxx:281
void WriteSxex(XclExpStream &rStrm) const
Writes the SXEX records containing additional pivot table info.
Definition: xepivot.cxx:1520
const XclExpPivotTable & mrPTable
Definition: xepivot.hxx:307
const XclExpPCItem * mpCacheItem
Definition: xepivot.hxx:248
XclExpPCItemList maGroupItemList
List with original items.
Definition: xepivot.hxx:150
XclExpRecordList< XclExpPivotCache > maPCacheList
Definition: xepivot.hxx:433
static void WriteSxivd(XclExpStream &rStrm, const ScfUInt16Vec &rFields)
Writes an SXIVD record for row field or column field order.
Definition: xepivot.cxx:1459
void SetPropertiesFromMember(const ScDPSaveMember &rSaveMem)
Fills this item with properties from the passed save member.
Definition: xepivot.cxx:920
ScfUInt16Vec maRowFields
All fields in pivot cache order.
Definition: xepivot.hxx:388
bool mbFilterBtn
true = The pivot table is valid for export.
Definition: xepivot.hxx:396
const XclExpPCItem * GetItem(sal_uInt16 nItemIdx) const
Returns the specified pivot cache item (returns visible items in groupings).
Definition: xepivot.cxx:267
Represents a field in a pivot cache.
Definition: xlpivot.hxx:477
void WriteSxpiEntry(XclExpStream &rStrm) const
Writes an entry for an SXPI record containing own page field info.
Definition: xepivot.cxx:1120
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xepivot.cxx:154
XclExpRecordList< XclExpPCItem > XclExpPCItemList
Definition: xepivot.hxx:96
void WritePivotTables(XclExpStream &rStrm, SCTAB nScTab)
Writes all pivot tables of the specified Calc sheet.
Definition: xepivot.cxx:1655
OUString GetFieldName() const
Returns the name of this field.
Definition: xepivot.cxx:953
XclExpRecordRef CreatePivotCachesRecord()
Creates a record wrapper for exporting all pivot caches.
Definition: xepivot.cxx:1640
rtl::Reference< XclExpPivotCache > XclExpPivotCacheRef
Definition: xepivot.hxx:222
const OUString & GetFieldName() const
Returns the name of this cache field.
Definition: xepivot.hxx:78
XclPTPageFieldInfo maPageInfo
Extended field info (SXVDEX record).
Definition: xepivot.hxx:311
Access to global data from other classes.
Definition: xeroot.hxx:113
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table field.
Definition: xepivot.cxx:1136
XclExpPTItem(const XclExpPCField &rCacheField, sal_uInt16 nCacheIdx)
Definition: xepivot.cxx:897
SCTAB GetScTab() const
Returns the output range of the pivot table.
Definition: xepivot.hxx:328
SCTAB mnOutScTab
Special data field orientation field.
Definition: xepivot.hxx:394
const XclExpPCField * GetField(sal_uInt16 nFieldIdx) const
Returns the specified pivot cache field.
Definition: xepivot.cxx:688
XclExpRecordList< XclExpPTItem > maItemList
List of extended data field info (SXDI records).
Definition: xepivot.hxx:315
XclExpPCItemList maOrigItemList
Definition: xepivot.hxx:149
sal_uInt16 InsertGroupItem(XclExpPCItem *pNewItem)
Inserts an item into the grouping item list.
Definition: xepivot.cxx:503
Contains extended data for a pivot table field (SXVDEX record).
Definition: xlpivot.hxx:621
bool HasItemIndexList() const
Returns true, if the item index list will be written.
Definition: xepivot.cxx:678
void SetNumGroupLimit(const ScDPNumGroupInfo &rNumInfo)
Inserts the SXDOUBLE items that specify the limits for a numeric grouping.
Definition: xepivot.cxx:545
void WriteSxvdex(XclExpStream &rStrm) const
Writes the SXVDEX record containing additional settings.
Definition: xepivot.cxx:1170
const XclExpPivotCache * CreatePivotCache(const ScDPObject &rDPObj)
Finds an existing (if enabled in mbShareCaches) or creates a new pivot cache.
Definition: xepivot.cxx:1665
Base class for all Excel records.
Definition: xerecord.hxx:38
void WriteSxdi(XclExpStream &rStrm, sal_uInt16 nDataInfoIdx) const
Writes an SXDI records containing info about a data field.
Definition: xepivot.cxx:1125
Contains data for a pivot table page field (part of SXPI record).
Definition: xlpivot.hxx:658
bool EqualsDateTime(const DateTime &rDateTime) const
Definition: xepivot.cxx:144
sal_uInt16 GetTypeFlag() const
Definition: xepivot.hxx:46
void InsertOrigDoubleItem(double fValue, const OUString &rText)
Inserts an original value item, if it is not contained already.
Definition: xepivot.cxx:470
::std::pair< sal_uInt16, sal_uInt16 > XclPTDataFieldPos
Data field position specifying the pivot table field index (first) and data info index (second)...
Definition: xepivot.hxx:226
void InitDateGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rDateInfo, sal_Int32 nDatePart)
Initializes a date grouping field.
Definition: xepivot.cxx:427
void SetDateGroupLimit(const ScDPNumGroupInfo &rDateInfo, bool bUseStep)
Inserts the SXDATETIME/SXINTEGER items that specify the limits for a date grouping.
Definition: xepivot.cxx:554
Contains data for a pivot table field (SXVD record).
Definition: xlpivot.hxx:592
XclExpPivotTableList maPTableList
List of all pivot caches.
Definition: xepivot.hxx:434
void SetDataFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table data field with all properties from the passed save dimension.
Definition: xepivot.cxx:1365
void WriteSxindexlistList(XclExpStream &rStrm) const
Writes the SXINDEXLIST record list containing the item index table.
Definition: xepivot.cxx:845
XclPTFieldExtInfo maFieldExtInfo
General field info (SXVD record).
Definition: xepivot.hxx:310
sal_uInt16 GetItemIndex(std::u16string_view rName, sal_uInt16 nDefaultIdx) const
Returns the list index of an item by its name.
Definition: xepivot.cxx:965
OUString GetItemName() const
Returns the internal name of this item.
Definition: xepivot.cxx:915
XclExpPCItemList maNumGroupLimits
Indexes into maItemList.
Definition: xepivot.hxx:152
void AddFields(const ScDPObject &rDPObj)
Adds all pivot cache fields.
Definition: xepivot.cxx:732
void WriteSxview(XclExpStream &rStrm) const
Writes the SXVIEW record starting the pivot table.
Definition: xepivot.cxx:1452
void AppendSubtotalItem(sal_uInt16 nItemType)
Appends a special item describing a field subtotal entry.
Definition: xepivot.cxx:1157
ScRange maOrigSrcRange
Range name for source data.
Definition: xepivot.hxx:215
void AddStdFields(const ScDPObject &rDPObj)
Adds all standard pivot cache fields based on source data.
Definition: xepivot.cxx:740
XclExpRecordList< XclExpPivotTable > XclExpPivotTableList
Definition: xepivot.hxx:430
void Finalize()
Initializes flags and item count fields.
Definition: xepivot.cxx:564
sal_uInt16 GetItemIndex(std::u16string_view rItemName) const
Returns the index of a pivot cache item, or EXC_PC_NOITEM on error.
Definition: xepivot.cxx:272
bool mbValid
List index in pivot cache buffer.
Definition: xepivot.hxx:219
ScfUInt16Vec maColFields
Row field indexes.
Definition: xepivot.hxx:389
The main class for pivot table export.
Definition: xepivot.hxx:406
virtual ~XclExpPCField() override
Definition: xepivot.cxx:250
XclExpRecordRef CreatePivotTablesRecord(SCTAB nScTab)
Creates a record wrapper for exporting all pivot tables of the specified sheet.
Definition: xepivot.cxx:1645
const XclExpPCItemList & GetVisItemList() const
Returns the item list that contains the visible items.
Definition: xepivot.cxx:318
Contains data for a pivot table data item (SXVI record).
Definition: xlpivot.hxx:575
void WriteIndex(XclExpStream &rStrm, sal_uInt32 nSrcRow) const
Writes the item index at the passed source row position as part of the SXINDEXLIST record...
Definition: xepivot.cxx:286
XclExpPCFieldList maFieldList
Pivot cache settings (SXDB record).
Definition: xepivot.hxx:212
void InsertOrigTextItem(const OUString &rText)
Inserts an original text item, if it is not contained already.
Definition: xepivot.cxx:457
void InsertOrigItem(XclExpPCItem *pNewItem)
Inserts an original source item.
Definition: xepivot.cxx:449
void WriteSxnumgroup(XclExpStream &rStrm)
Writes an SXNUMGROUP record and the additional items for a numeric grouping field.
Definition: xepivot.cxx:582
XclExpPTField(const XclExpPivotTable &rPTable, sal_uInt16 nCacheIdx)
Definition: xepivot.cxx:938
const int nIndexCount
Definition: qproform.cxx:566
sal_uInt16 GetCacheIndex() const
Returns the list index of the cache used in pivot table records.
Definition: xepivot.hxx:168
XclExpPivotCache(const XclExpRoot &rRoot, const ScDPObject &rDPObj, sal_uInt16 nListIdx)
Definition: xepivot.cxx:616
OUString maSrcRangeName
Name of source data sheet.
Definition: xepivot.hxx:214
bool EqualsDouble(double fValue) const
Definition: xepivot.cxx:139
void WriteCacheStream()
Creates the pivot cache storage stream and writes the cache.
Definition: xepivot.cxx:810
void SetPropertiesFromDP(const ScDPSaveData &rSaveData)
Fills internal members with all properties from the passed save data.
Definition: xepivot.cxx:1310
XclExpPCFieldList::RecordRefType XclExpPCFieldRef
Definition: xepivot.hxx:209
ScRange maDocSrcRange
The exported sheet source range.
Definition: xepivot.hxx:217
virtual void WriteBody(XclExpStream &rStrm) override
Writes the SXVI record body describing the pivot table item.
Definition: xepivot.cxx:933
void Save(XclExpStream &rStrm)
Writes related records into Workbook stream and creates the pivot cache storage stream.
Definition: xepivot.cxx:709
XclPCFieldInfo maFieldInfo
Definition: xlpivot.hxx:516
void WriteSxdb(XclExpStream &rStrm) const
Writes the SXDB record.
Definition: xepivot.cxx:830
const XclExpPivotCache & mrPCache
Definition: xepivot.hxx:383
bool EqualsBool(bool bValue) const
Definition: xepivot.cxx:149
XclExpPTFieldList::RecordRefType XclExpPTFieldRef
Definition: xepivot.hxx:381
Represents a data item in a pivot cache containing data of any type.
Definition: xepivot.hxx:37
void WriteSxvd(XclExpStream &rStrm) const
Writes the SXVD record introducing the field.
Definition: xepivot.cxx:1163
XclExpPCField(const XclExpRoot &rRoot, sal_uInt16 nFieldIdx, const ScDPObject &rDPObj, const ScRange &rRange)
Creates a standard pivot cache field, filled from sheet source data.
Definition: xepivot.cxx:190
static void WriteSxli(XclExpStream &rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount)
Writes a dummy SXLI records containing item layout info.
Definition: xepivot.cxx:1496
void InsertOrigBoolItem(bool bValue, const OUString &rText)
Inserts an original boolean item, if it is not contained already.
Definition: xepivot.cxx:492
XclPTViewEx9Info maPTViewEx9Info
Extended info about the pivot table (SXEX record).
Definition: xepivot.hxx:386
::std::vector< sal_uInt16 > ScfUInt16Vec
Definition: ftools.hxx:256
XclExpPTItem * GetItemAcc(std::u16string_view rName)
Returns an item by its name.
Definition: xepivot.cxx:1148
ScfUInt16Vec maPageFields
Column field indexes.
Definition: xepivot.hxx:390
XclExpPivotTableManager(const XclExpRoot &rRoot)
Definition: xepivot.cxx:1624
Contains data for a pivot cache (SXDB record).
Definition: xlpivot.hxx:526
XclExpRecordList< XclExpPCField > XclExpPCFieldList
Definition: xepivot.hxx:208
void WriteSxViewEx9(XclExpStream &rStrm) const
Writes the SX_AUTOFORMAT records with the autoformat id and header layout.
Definition: xepivot.cxx:1581
void InitStdGroupField(const XclExpPCField &rBaseField, const ScDPSaveGroupDimension &rGroupDim)
Initializes a standard grouping field.
Definition: xepivot.cxx:362
void AddGroupFields(const ScDPObject &rDPObj)
Adds all grouping pivot cache fields.
Definition: xepivot.cxx:755
XclPCInfo maPCInfo
Definition: xepivot.hxx:211
Represents a new group dimension whose dimension ID is higher than the highest source dimension ID...
Definition: dpdimsave.hxx:91
Contains data for a pivot table (SXVIEW record).
Definition: xlpivot.hxx:706
void WriteDConName(XclExpStream &rStrm) const
DCONNAME record contains range name source.
Definition: xepivot.cxx:802
XclExpPTFieldList maFieldList
The selected autoformat (SXVIEWEX9)
Definition: xepivot.hxx:387
XclPTInfo maPTInfo
The pivot cache this pivot table bases on.
Definition: xepivot.hxx:384
void Finalize()
Initializes any data after processing the entire source DataPilot.
Definition: xepivot.cxx:1376
void InsertNumDateGroupItems(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nDatePart=0)
Generates and inserts all visible items for numeric or date grouping.
Definition: xepivot.cxx:509
XclPTFieldInfo maFieldInfo
The referred pivot cache field.
Definition: xepivot.hxx:309
XclPTItemInfo maItemInfo
The referred pivot cache item.
Definition: xepivot.hxx:249
void InitStandardField(const ScRange &rRange)
Initializes a standard field.
Definition: xepivot.cxx:325
OUString maTabName
List of all pivot cache fields.
Definition: xepivot.hxx:213
static void WriteSxdbex(XclExpStream &rStrm)
Writes the SXDBEX record.
Definition: xepivot.cxx:837
const XclExpPCField * GetCacheField(sal_uInt16 nCacheIdx) const
Returns a pivot cache field.
Definition: xepivot.cxx:1234
void WritePivotCaches(XclExpStream &rStrm)
Writes all pivot caches (all Workbook records and cache streams).
Definition: xepivot.cxx:1650
void SetDataPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with data field properties from the passed save dimension.
Definition: xepivot.cxx:1068
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table.
Definition: xepivot.cxx:1261
std::vector< XclPTDataFieldPos > maDataFields
Page field indexes.
Definition: xepivot.hxx:392
void InsertOrigDateTimeItem(const DateTime &rDateTime, const OUString &rText)
Inserts an original date/time item, if it is not contained already.
Definition: xepivot.cxx:481
static void SaveXml(XclExpXmlStream &rStrm)
Definition: xepivot.cxx:728
sal_uInt16 GetFieldCount() const
Returns the number of pivot cache fields.
Definition: xepivot.cxx:683
sal_uInt16 GetFieldIndex() const
Returns the pivot table field list index of this field.
Definition: xepivot.hxx:264
const XclExpPTField * GetField(sal_uInt16 nFieldIdx) const
Returns a pivot table field by its name.
Definition: xepivot.cxx:1239
void WriteDconref(XclExpStream &rStrm) const
Writes the DCONREF record containing the source range.
Definition: xepivot.cxx:789
void WriteSxgroupinfo(XclExpStream &rStrm)
Writes an SXGROUPINFO record describing the item order in grouping fields.
Definition: xepivot.cxx:598
XclExpRecordList< XclExpPTField > XclExpPTFieldList
Definition: xepivot.hxx:380
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SXFIELD record for this field.
Definition: xepivot.cxx:611
sal_uInt16 mnTypeFlag
Definition: xepivot.hxx:57
void SvStream & rStrm
bool mbValid
Sheet index of the output range.
Definition: xepivot.hxx:395
OUString maName
Definition: xlpivot.hxx:438
sal_uInt16 GetLastDataInfoIndex() const
Returns the index of the last inserted data info struct.
Definition: xepivot.cxx:958
void WriteQsiSxTag(XclExpStream &rStrm) const
Definition: xepivot.cxx:1527
void InitNumGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo)
Initializes a numeric grouping field.
Definition: xepivot.cxx:403
XclExpPTField * GetFieldAcc(std::u16string_view rName)
Returns a pivot table field by its name.
Definition: xepivot.cxx:1288
Base class for single records with any content.
Definition: xerecord.hxx:142
sal_Int16 SCTAB
Definition: types.hxx:23
sal_uInt16 mnTypeFlags
List with limit values for numeric grouping.
Definition: xepivot.hxx:153
sal_Int16 nValue
bool EqualsText(std::u16string_view rText) const
Definition: xepivot.cxx:134
sal_uInt16 GetDataFieldIndex(const OUString &rName, sal_uInt16 nDefaultIdx) const
Returns the data-field-only index of the first data field with the passed name.
Definition: xepivot.cxx:1249
Represents a data item of any type in a pivot cache.
Definition: xlpivot.hxx:367