diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/queryiter.hxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/queryiter.cxx | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/inc/queryiter.hxx b/sc/inc/queryiter.hxx index c2378bca6aa2..f5cba350bff2 100644 --- a/sc/inc/queryiter.hxx +++ b/sc/inc/queryiter.hxx @@ -87,9 +87,9 @@ protected: /* Only works if no regular expression is involved, only searches for rows in one column, and only the first query entry is considered with simple conditions SC_LESS_EQUAL - (sorted ascending) or SC_GREATER_EQUAL (sorted descending). Check these things before - invocation! Delivers a starting point, continue with e.g. GetThis() and GetNext() - afterwards. Introduced for FindEqualOrSortedLastInRange(). */ + (sorted ascending) or SC_GREATER_EQUAL (sorted descending). Delivers a starting point, + continue with e.g. GetThis() and GetNext() afterwards. Introduced + for FindEqualOrSortedLastInRange(). */ bool BinarySearch(); public: diff --git a/sc/source/core/data/queryiter.cxx b/sc/source/core/data/queryiter.cxx index 040dfdfc403d..cbdd83668920 100644 --- a/sc/source/core/data/queryiter.cxx +++ b/sc/source/core/data/queryiter.cxx @@ -505,6 +505,14 @@ public: template< ScQueryCellIteratorType iteratorType > bool ScQueryCellIteratorBase< iteratorType >::BinarySearch() { + assert(maParam.GetEntry(0).bDoQuery && !maParam.GetEntry(1).bDoQuery + && maParam.GetEntry(0).GetQueryItems().size() == 1 ); + assert(maParam.eSearchType == utl::SearchParam::SearchType::Normal); + assert(maParam.GetEntry(0).GetQueryItem().meType == ScQueryEntry::ByString + || maParam.GetEntry(0).GetQueryItem().meType == ScQueryEntry::ByValue); + assert(maParam.bByRow); + assert(maParam.GetEntry(0).eOp == SC_LESS_EQUAL || maParam.GetEntry(0).eOp == SC_GREATER_EQUAL); + // TODO: This will be extremely slow with mdds::multi_type_vector. assert(nTab < rDoc.GetTableCount() && "index out of bounds, FIX IT"); |