diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-12-21 14:57:27 +0000 |
---|---|---|
committer | Kohei Yoshida <libreoffice@kohei.us> | 2015-12-22 17:31:26 +0000 |
commit | cd945a000623838e96b7dd534ca618071c44995d (patch) | |
tree | 3badd42411396584e22c2c5fa1bb3083e6c7273b /sc/source/core | |
parent | 53bf6ef85c09717369074e6fd0f1ae1fbe54405c (diff) |
tdf#96588 - avoid redundant pivot cache filter on import.
No need to do a duplicate ~million calls to isRowQualified for trailing
empty data.
Change-Id: Id2840e1b5a9aae825aa67af9b4cedb32c3fcf527
Reviewed-on: https://gerrit.libreoffice.org/20851
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/dpfilteredcache.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx index 5714ad2113d6..f9ea8f2b3851 100644 --- a/sc/source/core/data/dpfilteredcache.cxx +++ b/sc/source/core/data/dpfilteredcache.cxx @@ -265,15 +265,23 @@ bool ScDPFilteredCache::isRowActive(sal_Int32 nRow, sal_Int32* pLastRow) const void ScDPFilteredCache::filterByPageDimension(const vector<Criterion>& rCriteria, const std::unordered_set<sal_Int32>& rRepeatIfEmptyDims) { SCROW nRowSize = getRowSize(); + SCROW nDataSize = mrCache.GetDataSize(); maShowByPage.clear(); - for (SCROW nRow = 0; nRow < nRowSize; ++nRow) + for (SCROW nRow = 0; nRow < nDataSize; ++nRow) { bool bShow = isRowQualified(nRow, rCriteria, rRepeatIfEmptyDims); maShowByPage.insert_back(nRow, nRow+1, bShow); } + // tdf#96588 - rapidly extend for blank rows with identical data + if (nDataSize < nRowSize) + { + bool bBlankShow = isRowQualified(nDataSize, rCriteria, rRepeatIfEmptyDims); + maShowByPage.insert_back(nDataSize, nRowSize, bBlankShow); + } + maShowByPage.build_tree(); } |