diff options
author | Eike Rathke <erack@redhat.com> | 2011-11-24 21:44:40 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2011-11-25 01:01:15 +0100 |
commit | f37a539b79f601e047fefee06357b5538c6c81b0 (patch) | |
tree | 95d13d6f5fea2835bcee09d6f335c0816944c879 /sc | |
parent | 811de66d7fd8c93c43d8e4e2dc73720033ba939b (diff) |
calc67: #i117661# filterByPageDimension: don't overwrite source filter with page field selection
# Original author: Niklas Nebel <nn@openoffice.org>
* found as LGPLv3-only fix at svn rev 1167326 (http://svn.apache.org/viewvc?view=revision&revision=1167326)
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/dptabsrc.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/dptabsrc.cxx | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 0519bd20b1ac..79986f734db8 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -132,6 +132,7 @@ private: std::vector<ScDPLevel*> aColLevelList; std::vector<ScDPLevel*> aRowLevelList; sal_Bool bResultOverflow; + bool bPageFiltered; // set if page field filters have been applied to cache table SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<rtl::OUString> mpGrandTotalName; diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index b0ac47722a3d..928cb8670936 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -139,6 +139,7 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : pColResults( NULL ), pRowResults( NULL ), bResultOverflow( false ), + bPageFiltered( false ), mpGrandTotalName(NULL) { pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); @@ -576,6 +577,7 @@ void ScDPSource::disposeData() nColDimCount = nRowDimCount = nDataDimCount = nPageDimCount = 0; pData->DisposeData(); // cached entries etc. + bPageFiltered = false; bResultOverflow = false; } @@ -728,6 +730,19 @@ void ScDPSource::GetCategoryDimensionIndices(boost::unordered_set<sal_Int32>& rC void ScDPSource::FilterCacheTableByPageDimensions() { + // #i117661# Repeated calls to ScDPCacheTable::filterByPageDimension are invalid because + // rows are only hidden, never shown again. If FilterCacheTableByPageDimensions is called + // again, the cache table must be re-initialized. Currently, CreateRes_Impl always uses + // a fresh cache because ScDBDocFunc::DataPilotUpdate calls InvalidateData. + + if (bPageFiltered) + { + DBG_ERRORFILE("tried to apply page field filters several times"); + + pData->DisposeData(); + pData->CreateCacheTable(); // re-initialize the cache table + bPageFiltered = false; + } // filter table by page dimensions. vector<ScDPCacheTable::Criterion> aCriteria; @@ -774,6 +789,7 @@ void ScDPSource::FilterCacheTableByPageDimensions() boost::unordered_set<sal_Int32> aCatDims; GetCategoryDimensionIndices(aCatDims); pData->FilterCacheTable(aCriteria, aCatDims); + bPageFiltered = true; } } |