sc/inc/column.hxx | 5 ++++- sc/source/core/data/column3.cxx | 7 +++++-- sc/source/core/data/table3.cxx | 9 +++++++-- 3 files changed, 16 insertions(+), 5 deletions(-)
New commits: commit 878a5dabff4669fb606a461e11eaf286d0c8b07f Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Tue Apr 29 15:32:18 2014 -0400 fdo#74650: Speed up GetFilteredFilterEntries(). Change-Id: I1b3ae601726401a0e70fb1a05b9a90c43773794c diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 7f6f81c..0e13ec9 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -460,7 +460,10 @@ public: /// Including current, may return -1 SCsROW GetNextUnprotected( SCROW nRow, bool bUp ) const; - void GetFilterEntries(SCROW nStartRow, SCROW nEndRow, std::vector<ScTypedStrData>& rStrings, bool& rHasDates); + void GetFilterEntries( + sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, + std::vector<ScTypedStrData>& rStrings, bool& rHasDates ); + bool GetDataEntries( SCROW nRow, std::set<ScTypedStrData>& rStrings, bool bLimit ) const; void UpdateInsertTabAbs(SCTAB nNewPos); diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 3008fec..e3a81a5 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2047,10 +2047,13 @@ public: } -void ScColumn::GetFilterEntries(SCROW nStartRow, SCROW nEndRow, std::vector<ScTypedStrData>& rStrings, bool& rHasDates) +void ScColumn::GetFilterEntries( + sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, + std::vector<ScTypedStrData>& rStrings, bool& rHasDates ) { FilterEntriesHandler aFunc(*this, rStrings); - sc::ParseAllNonEmpty(maCells.begin(), maCells, nStartRow, nEndRow, aFunc); + rBlockPos.miCellPos = + sc::ParseAllNonEmpty(rBlockPos.miCellPos, maCells, nStartRow, nEndRow, aFunc); rHasDates = aFunc.hasDates(); } diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index acd8f5e..2cf6c1b 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2556,12 +2556,17 @@ bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol * void ScTable::GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, std::vector<ScTypedStrData>& rStrings, bool& rHasDates) { - aCol[nCol].GetFilterEntries( nRow1, nRow2, rStrings, rHasDates ); + sc::ColumnBlockConstPosition aBlockPos; + aCol[nCol].InitBlockPosition(aBlockPos); + aCol[nCol].GetFilterEntries(aBlockPos, nRow1, nRow2, rStrings, rHasDates); } void ScTable::GetFilteredFilterEntries( SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, std::vector<ScTypedStrData>& rStrings, bool& rHasDates) { + sc::ColumnBlockConstPosition aBlockPos; + aCol[nCol].InitBlockPosition(aBlockPos); + // remove the entry for this column from the query parameter ScQueryParam aParam( rParam ); aParam.RemoveEntryByField(nCol); @@ -2573,7 +2578,7 @@ void ScTable::GetFilteredFilterEntries( if (ValidQuery(j, aParam)) { bool bThisHasDates = false; - aCol[nCol].GetFilterEntries( j, j, rStrings, bThisHasDates ); + aCol[nCol].GetFilterEntries(aBlockPos, j, j, rStrings, bThisHasDates); bHasDates |= bThisHasDates; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits