From 248e49d3f409d414331945ba91b3083406d59f78 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 10 May 2022 12:49:55 +0200 Subject: no PerformQuery() with ScSortedRangeCache if not needed (tdf#144777) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It should not be necessary in that case, since the rows are restricted only to those that match, selected by BinarySearch(). Still at least assert that, just in case I'm missing something (or BinarySearch() doesn't quite match what validQuery() does). Change-Id: Ie91d3ba997692e5b3650b1549e8a38b6c5f44c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134130 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- sc/inc/queryiter.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sc/inc/queryiter.hxx') diff --git a/sc/inc/queryiter.hxx b/sc/inc/queryiter.hxx index 7c454f784a2e..fa8f08083981 100644 --- a/sc/inc/queryiter.hxx +++ b/sc/inc/queryiter.hxx @@ -94,12 +94,15 @@ class ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::SortedCache { public: void SetSortedRangeCache( const ScSortedRangeCache& cache ); + template + bool IncPosImpl(); protected: ScQueryCellIteratorAccessSpecific( ScDocument& rDocument, ScInterpreterContext& rContext, const ScQueryParam& rParam ); void InitPosStart(); void InitPosFinish( SCROW beforeRow, SCROW lastRow ); - void IncPos(); + void IncPos() { IncPosImpl(); } + bool IncPosFast() { return IncPosImpl(); } void IncBlock() { IncPos(); } // Cannot skip entire block, not linear. // These members needs to be available already in the base class. @@ -111,6 +114,7 @@ protected: SCTAB nTab; SCCOL nCol; SCROW nRow; + const ScColumn* pColumn; // matching nCol, set by InitPos() const ScSortedRangeCache* sortedCache; size_t sortedCachePos; -- cgit