helpcontent2 | 2 - sc/inc/queryiter.hxx | 2 - sc/qa/unit/ucalc_sort.cxx | 46 +++++++++++++++++++------------------- sc/source/core/data/queryiter.cxx | 6 ++-- 4 files changed, 28 insertions(+), 28 deletions(-)
New commits: commit 4b87523605cf87b548d6eb2604c1d5e84f925038 Author: Seth Chaiklin <sdc.bla...@youmail.dk> AuthorDate: Wed May 11 10:46:23 2022 +0100 Commit: Gerrit Code Review <ger...@gerrit.libreoffice.org> CommitDate: Wed May 11 11:46:23 2022 +0200 Update git submodules * Update helpcontent2 from branch 'master' to 61b4b76000bd5adca504df0966ecef3410765ab3 - tdf#149012 updating of Options tab for Frame, Object, Image text/swriter/01/05060900.xhp * corrections to control names + added embed to "Description" which was missing, but an adjustment will be needed in a subsequent patch because the embedded file header describes the command "Description" and not the field in the Options dialog box. But the description is close enough to be useful for now, and another patch will be needed here because of changes to the dialog as a result of tdf#148941, so necessary adjustments can be made as part of that followup patch. * identify "frame only" controls * change position of "Content Alignment" to match dialog * refactor to <h1>,<h2>,<h3>,<tip> text/swriter/00/00000405.xhp * clarify that frame styles should be used in sidebar * refactor to <menuitem> for clarified paragraph Change-Id: I82e62a2d2fd49c44b779ac79e102a5b8623196ba Reviewed-on: https://gerrit.libreoffice.org/c/help/+/134065 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/helpcontent2 b/helpcontent2 index 44126837152e..61b4b76000bd 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 44126837152e16fa861ded498f315d57b574e441 +Subproject commit 61b4b76000bd5adca504df0966ecef3410765ab3 commit 976a07a1dfbb136ac4f4daa6dddbda608390db7d Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Fri May 6 20:45:01 2022 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed May 11 11:45:52 2022 +0200 make it obvious which column BinarySearch() operates on It was setting the column to ScQueryParams.nCol1, which was somewhat confusing. Change-Id: I3ab2207f507a4dc3782ea78682dacb0b08c36b19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134123 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/inc/queryiter.hxx b/sc/inc/queryiter.hxx index f151bba90ab6..5370dd0fb211 100644 --- a/sc/inc/queryiter.hxx +++ b/sc/inc/queryiter.hxx @@ -148,7 +148,7 @@ protected: or if the range is not properly sorted, with nRow in that case set to the first row or after the last row. In that case use GetFirst(). */ - bool BinarySearch(); + bool BinarySearch( SCCOL col ); public: ScQueryCellIteratorBase(ScDocument& rDocument, const ScInterpreterContext& rContext, SCTAB nTable, diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx index b381d6195b04..23b32e9a5b66 100644 --- a/sc/qa/unit/ucalc_sort.cxx +++ b/sc/qa/unit/ucalc_sort.cxx @@ -2099,19 +2099,19 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS_EQUAL, 5 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(8), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS, 5 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(2), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_EQUAL, 5 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(8), it.GetRow()); } @@ -2123,13 +2123,13 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER_EQUAL, 5 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(6), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER, 5 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(1), it.GetRow()); } @@ -2141,19 +2141,19 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS_EQUAL, 6 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(8), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS, 6 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(8), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_EQUAL, 6 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(8), it.GetRow()); } @@ -2165,13 +2165,13 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER_EQUAL, 6 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(1), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER, 6 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(1), it.GetRow()); } @@ -2183,19 +2183,19 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS_EQUAL, 0 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS, 0 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_EQUAL, 0 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } @@ -2207,13 +2207,13 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER_EQUAL, 0 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(10), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER, 0 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(10), it.GetRow()); } @@ -2225,19 +2225,19 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS_EQUAL, 10 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(10), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_LESS, 10 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(10), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, ascendingCol, SC_EQUAL, 10 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(it.BinarySearch()); + CPPUNIT_ASSERT(it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(10), it.GetRow()); } @@ -2249,13 +2249,13 @@ void TestSort::testQueryBinarySearch() ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER_EQUAL, 10 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } { ScQueryParam param = makeSearchParam( range, descendingCol, SC_GREATER, 10 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } @@ -2263,7 +2263,7 @@ void TestSort::testQueryBinarySearch() // Search as ascending but use descending range, will return no match. ScQueryParam param = makeSearchParam( range, descendingCol, SC_LESS_EQUAL, 1 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } @@ -2271,7 +2271,7 @@ void TestSort::testQueryBinarySearch() // Search as descending but use ascending range, will return no match. ScQueryParam param = makeSearchParam( range, ascendingCol, SC_GREATER_EQUAL, 9 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( ascendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } @@ -2279,7 +2279,7 @@ void TestSort::testQueryBinarySearch() // SC_EQUAL with descending is considered an error, will return no match. ScQueryParam param = makeSearchParam( range, descendingCol, SC_EQUAL, 9 ); TestQueryIterator it( *m_pDoc, m_pDoc->GetNonThreadedContext(), 0, param, false ); - CPPUNIT_ASSERT(!it.BinarySearch()); + CPPUNIT_ASSERT(!it.BinarySearch( descendingCol )); CPPUNIT_ASSERT_EQUAL(SCROW(0), it.GetRow()); } diff --git a/sc/source/core/data/queryiter.cxx b/sc/source/core/data/queryiter.cxx index 6f8f6483140a..deea08fd9b1f 100644 --- a/sc/source/core/data/queryiter.cxx +++ b/sc/source/core/data/queryiter.cxx @@ -275,7 +275,7 @@ void decBlock(std::pair<Iter, size_t>& rPos) } template< ScQueryCellIteratorAccess accessType, ScQueryCellIteratorType queryType > -bool ScQueryCellIteratorBase< accessType, queryType >::BinarySearch() +bool ScQueryCellIteratorBase< accessType, queryType >::BinarySearch( SCCOL col ) { assert(maParam.GetEntry(0).bDoQuery && !maParam.GetEntry(1).bDoQuery && maParam.GetEntry(0).GetQueryItems().size() == 1 ); @@ -290,7 +290,7 @@ bool ScQueryCellIteratorBase< accessType, queryType >::BinarySearch() // TODO: This will be extremely slow with mdds::multi_type_vector. assert(nTab < rDoc.GetTableCount() && "index out of bounds, FIX IT"); - nCol = maParam.nCol1; + nCol = col; nRow = maParam.nRow1; if (nCol >= rDoc.maTabs[nTab]->GetAllocatedColumnsCount()) @@ -632,7 +632,7 @@ bool ScQueryCellIterator< accessType >::FindEqualOrSortedLastInRange( SCCOL& nFo bool bFound = false; if (bBinary) { - if (BinarySearch()) + if (BinarySearch( maParam.nCol1 )) { // BinarySearch() already positions correctly and only needs real // query comparisons afterwards, skip the verification check below.