summaryrefslogtreecommitdiffstats
path: root/sc/source/filter/inc
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-10-09 20:07:33 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2016-10-09 20:20:59 +0200
commit03a1143cc75161dab56b20f1ab9e723ddd0caa8e (patch)
treee6262d077252175261b0d8892ee0ada3c4433936 /sc/source/filter/inc
parentPivot table tests: Check also grouped fields' name. (diff)
downloadcore-03a1143cc75161dab56b20f1ab9e723ddd0caa8e.tar.gz
core-03a1143cc75161dab56b20f1ab9e723ddd0caa8e.zip
tdf#102694, bnc#957991: Improve pivot cache reading performance
When two or more tables have the same source data, then the grouping of source fields are shared between these tables, so don't need to import these grouping for each tables. The added code checkes whether we already imported the group fields and don't create them again using API functions, but apply the exisiting groups of an other table sharing the source. Change-Id: Iad6be9a9e30944ab9a241c8498eff95c6c356689
Diffstat (limited to 'sc/source/filter/inc')
-rw-r--r--sc/source/filter/inc/pivotcachebuffer.hxx6
-rw-r--r--sc/source/filter/inc/pivottablebuffer.hxx5
2 files changed, 11 insertions, 0 deletions
diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx b/sc/source/filter/inc/pivotcachebuffer.hxx
index 6b35a11ffa07..80e2f45972e7 100644
--- a/sc/source/filter/inc/pivotcachebuffer.hxx
+++ b/sc/source/filter/inc/pivotcachebuffer.hxx
@@ -186,6 +186,8 @@ struct PCFieldGroupModel
bool mbDateGroup; /// True = items are grouped by date ranges or by item names.
bool mbAutoStart; /// True = start value for range groups is calculated from source data.
bool mbAutoEnd; /// True = end value for range groups is calculated from source data.
+ OUString msFinalGroupName ; /// Finalized group name of this field used in internal pivot table collaction.
+
explicit PCFieldGroupModel();
@@ -269,6 +271,10 @@ public:
inline sal_Int32 getParentGroupField() const { return maFieldGroupModel.mnParentField; }
/** Returns the index of the base field grouping is based on. */
inline sal_Int32 getGroupBaseField() const { return maFieldGroupModel.mnBaseField; }
+ /** Returns the finalized group name of this field. */
+ inline const OUString& getFinalGroupName() const { return maFieldGroupModel.msFinalGroupName; }
+ /** Set the finalized group name of this field. */
+ inline void setFinalGroupName(const OUString& rFinalGroupName) { maFieldGroupModel.msFinalGroupName = rFinalGroupName; }
/** Returns the shared or group item with the specified index. */
const PivotCacheItem* getCacheItem( sal_Int32 nItemIdx ) const;
diff --git a/sc/source/filter/inc/pivottablebuffer.hxx b/sc/source/filter/inc/pivottablebuffer.hxx
index dfe52206ad6f..ebc001a2dfa6 100644
--- a/sc/source/filter/inc/pivottablebuffer.hxx
+++ b/sc/source/filter/inc/pivottablebuffer.hxx
@@ -149,6 +149,8 @@ public:
const css::uno::Reference< css::sheet::XDataPilotField >& rxBaseDPField,
const PivotCacheField& rBaseCacheField,
PivotCacheGroupItemVector& orItemNames );
+ void finalizeImportBasedOnCache(
+ const css::uno::Reference< css::sheet::XDataPilotDescriptor >& rxDPDesc);
/** Returns the name of the DataPilot field in the fields collection. */
inline const OUString& getDPFieldName() const { return maDPFieldName; }
@@ -317,6 +319,8 @@ public:
PivotTableFilter& createTableFilter();
/** Inserts the pivot table into the sheet. */
void finalizeImport();
+ /** Creates all group fields for the table after import. */
+ void finalizeFieldsImport();
/** Creates all date group fields for the specified cache field after import. */
void finalizeDateGroupingImport(
const css::uno::Reference< css::sheet::XDataPilotField >& rxBaseDPField,
@@ -377,6 +381,7 @@ private:
PivotCache* mpPivotCache; /// The pivot cache this table is based on.
css::uno::Reference< css::sheet::XDataPilotDescriptor >
mxDPDescriptor; /// Descriptor of the DataPilot object.
+
};
class PivotTableBuffer : public WorkbookHelper