LibreOffice Module sc (master) 1
xepivotxml.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
10#pragma once
11
12#include "xerecord.hxx"
13#include "xeroot.hxx"
14
15#include <memory>
16#include <map>
17#include <unordered_map>
18
19class ScDPCache;
20class ScDPObject;
21
23{
24public:
25 struct Entry
26 {
29 };
30
31 XclExpXmlPivotCaches(const XclExpRoot& rRoot);
32 virtual void SaveXml(XclExpXmlStream& rStrm) override;
33
34 void SetCaches(std::vector<Entry>&& rCaches);
35 bool HasCaches() const;
36 const Entry* GetCache(sal_Int32 nCacheId) const;
37
38private:
39 void SavePivotCacheXml(XclExpXmlStream& rStrm, const Entry& rEntry, sal_Int32 nCacheId);
40
41private:
42 std::vector<Entry> maCaches;
43};
44
46{
47 struct Entry
48 {
50 sal_Int32 mnCacheId;
51 sal_Int32 mnPivotId;
52
53 Entry(const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId);
54 };
55
57 typedef std::vector<Entry> TablesType;
59
60public:
61 XclExpXmlPivotTables(const XclExpRoot& rRoot, const XclExpXmlPivotCaches& rCaches);
62
63 virtual void SaveXml(XclExpXmlStream& rStrm) override;
64
65 void AppendTable(const ScDPObject* pTable, sal_Int32 nCacheId, sal_Int32 nPivotId);
66
67private:
68 void SavePivotTableXml(XclExpXmlStream& rStrm, const ScDPObject& rObj, sal_Int32 nCacheId);
69};
70
72{
73 typedef std::map<SCTAB, std::unique_ptr<XclExpXmlPivotTables>> TablesType;
74 typedef std::unordered_map<const ScDPObject*, sal_Int32> CacheIdMapType;
75
76public:
78
79 void Initialize();
80
83
84private:
88};
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class represents the cached data part of the datapilot cache table implementation.
Definition: dpcache.hxx:48
Base class for all Excel records.
Definition: xerecord.hxx:39
Access to global data from other classes.
Definition: xeroot.hxx:113
const Entry * GetCache(sal_Int32 nCacheId) const
Definition: xepivotxml.cxx:174
void SavePivotCacheXml(XclExpXmlStream &rStrm, const Entry &rEntry, sal_Int32 nCacheId)
Definition: xepivotxml.cxx:245
bool HasCaches() const
Definition: xepivotxml.cxx:169
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xepivotxml.cxx:133
XclExpXmlPivotCaches(const XclExpRoot &rRoot)
Definition: xepivotxml.cxx:130
void SetCaches(std::vector< Entry > &&rCaches)
Definition: xepivotxml.cxx:164
std::vector< Entry > maCaches
Definition: xepivotxml.hxx:42
XclExpXmlPivotCaches & GetCaches()
Definition: xepivotxml.cxx:621
std::unordered_map< const ScDPObject *, sal_Int32 > CacheIdMapType
Definition: xepivotxml.hxx:74
CacheIdMapType maCacheIdMap
Definition: xepivotxml.hxx:87
XclExpXmlPivotTables * GetTablesBySheet(SCTAB nTab)
Definition: xepivotxml.cxx:626
XclExpXmlPivotCaches maCaches
Definition: xepivotxml.hxx:85
XclExpXmlPivotTableManager(const XclExpRoot &rRoot)
Definition: xepivotxml.cxx:545
std::map< SCTAB, std::unique_ptr< XclExpXmlPivotTables > > TablesType
Definition: xepivotxml.hxx:73
XclExpXmlPivotTables(const XclExpRoot &rRoot, const XclExpXmlPivotCaches &rCaches)
Definition: xepivotxml.cxx:635
void SavePivotTableXml(XclExpXmlStream &rStrm, const ScDPObject &rObj, sal_Int32 nCacheId)
Definition: xepivotxml.cxx:746
std::vector< Entry > TablesType
Definition: xepivotxml.hxx:57
void AppendTable(const ScDPObject *pTable, sal_Int32 nCacheId, sal_Int32 nPivotId)
const XclExpXmlPivotCaches & mrCaches
Definition: xepivotxml.hxx:56
virtual void SaveXml(XclExpXmlStream &rStrm) override
Definition: xepivotxml.cxx:638
const ScDPCache * mpCache
Definition: xepivotxml.hxx:27
Entry(const ScDPObject *pTable, sal_Int32 nCacheId, sal_Int32 nPivotId)
used as [n] in pivotTable[n].xml part name.
Definition: xepivotxml.cxx:632
const ScDPObject * mpTable
Definition: xepivotxml.hxx:49
sal_Int16 SCTAB
Definition: types.hxx:22