From 7dcfb8417f82be1fb496702afb4d0f54cb74839f Mon Sep 17 00:00:00 2001 From: Balazs Varga Date: Sun, 3 Nov 2024 19:34:57 +0100 Subject: tdf#163736 - sc: fix searchmode cached values for lookup functions Check the search mode option in cache for lookup functions, because different search modes can produce different results. Change-Id: I6127a644dc4eae6fad909a6bc83bde2c66e85201 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175972 Reviewed-by: Regina Henschel Reviewed-by: Balazs Varga Tested-by: Jenkins (cherry picked from commit 223696267759326af4e436e0330026e4ff8ee8e0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175988 Reviewed-by: Xisco Fauli --- sc/inc/lookupcache.hxx | 24 +- .../data/functions/spreadsheet/fods/xmatch.fods | 266 ++++++++++++++++----- sc/source/core/tool/interpr1.cxx | 2 +- sc/source/core/tool/lookupcache.cxx | 11 +- 4 files changed, 227 insertions(+), 76 deletions(-) (limited to 'sc') diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx index ca1d333880fa..00194ebd162c 100644 --- a/sc/inc/lookupcache.hxx +++ b/sc/inc/lookupcache.hxx @@ -56,6 +56,14 @@ public: GREATER_EQUAL }; + enum SearchMode + { + SEARCHFWD = 1, + SEARCHREV = -1, + SEARCHBASC = 2, + SEARCHDESC = -2 + }; + class QueryCriteria { union @@ -66,6 +74,7 @@ public: bool mbAlloc; bool mbString; QueryOp meOp; + SearchMode meSearchMode; void deleteString() { @@ -77,11 +86,12 @@ public: public: - explicit QueryCriteria( const ScQueryEntry & rEntry ); + explicit QueryCriteria( const ScQueryEntry & rEntry, sal_Int8 nSearchMode ); QueryCriteria( const QueryCriteria & r ); ~QueryCriteria(); QueryOp getQueryOp() const { return meOp; } + SearchMode getSearchMode() const { return meSearchMode; } void setDouble( double fVal ) { @@ -99,7 +109,7 @@ public: bool operator==( const QueryCriteria & r ) const { - return meOp == r.meOp && mbString == r.mbString && + return meOp == r.meOp && meSearchMode == r.meSearchMode && mbString == r.mbString && (mbString ? (*mpStr == *r.mpStr) : (mfVal == r.mfVal)); } @@ -153,17 +163,20 @@ private: SCROW mnRow; SCTAB mnTab; QueryOp meOp; + SearchMode meSearchMode; - QueryKey( const ScAddress & rAddress, const QueryOp eOp ) : + QueryKey( const ScAddress & rAddress, const QueryOp eOp, SearchMode eSearchMode ) : mnRow( rAddress.Row()), mnTab( rAddress.Tab()), - meOp( eOp) + meOp( eOp), + meSearchMode( eSearchMode) { } bool operator==( const QueryKey & r ) const { - return mnRow == r.mnRow && mnTab == r.mnTab && meOp == r.meOp && meOp != UNKNOWN; + return mnRow == r.mnRow && mnTab == r.mnTab && meOp == r.meOp && meOp != UNKNOWN && + meSearchMode == r.meSearchMode; } struct Hash @@ -172,6 +185,7 @@ private: { return (static_cast(r.mnTab) << 24) ^ (static_cast(r.meOp) << 22) ^ + (static_cast(r.meSearchMode) << 20) ^ static_cast(r.mnRow); } }; diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods b/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods index 7ba23d505bb3..c5156957acde 100644 --- a/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods +++ b/sc/qa/unit/data/functions/spreadsheet/fods/xmatch.fods @@ -1,7 +1,7 @@ - - 2024-01-16T18:30:06.278000000PT2H53M47S51LibreOfficeDev/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/449050477173ff56b3f3d94406913b261f541b0f2024-06-26T18:59:52.334000000 + + 2024-01-16T18:30:06.278000000PT3H3M8S58LibreOfficeDev/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/a379e033425053885724b163147892f21830bca02024-11-03T18:27:19.548583300 0 @@ -30,13 +30,13 @@ false - 0 - 34 + 3 + 37 2 0 0 0 - 0 + 19 0 100 60 @@ -48,7 +48,7 @@ Sheet1 - 1539 + 1851 0 100 60 @@ -79,53 +79,60 @@ - true - true - true - 0 - true + true + true true - false - true - false - - - en - US - - - - - + true + false + bBb+/01pY3Jvc29mdCBQcmludCB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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAENPTVBBVF9EVVBMRVhfTU9ERRMARHVwbGV4TW9kZTo6VW5rbm93bgwAUFJJTlRFUl9OQU1FFgBNaWNyb3NvZnQgUHJpbnQgdG8gUERGCwBEUklWRVJfTkFNRRYATWljcm9zb2Z0IFByaW50IFRvIFBERg== + true 12632256 + true + false + 3 true + true true - 0 - false - false true - true false - 3 - false - Microsoft Print to PDF - false - ZBb+/01pY3Jvc29mdCBQcmludCB0byBQREYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATWljcm9zb2Z0IFByaW50IFRvIFBERgAAAAAAAAAAAAAWAAEANhUAAAAAAAAEAAhSAAAEdAAAM1ROVwAAAAAKAE0AaQBjAHIAbwBzAG8AZgB0ACAAUAByAGkAbgB0ACAAdABvACAAUABEAEYAAAAAAAAAAAAAAAAAAAAAAAAAAAABBAMG3ABQFAMvAQABAAkAmgs0CGQAAQAPAFgCAgABAFgCAwABAEEANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAIAAAABAAAA/////0dJUzQAAAAAAAAAAAAAAABESU5VIgDIACQDLBE/XXt+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgBDT01QQVRfRFVQTEVYX01PREUTAER1cGxleE1vZGU6OlVua25vd24MAFBSSU5URVJfTkFNRRYATWljcm9zb2Z0IFByaW50IHRvIFBERgsARFJJVkVSX05BTUUWAE1pY3Jvc29mdCBQcmludCBUbyBQREY= false 1270 1270 1 1 + true + true + true + Microsoft Print to PDF + 0 + false true + + + de + DE + + + + + + en + US + + + + + + 0 false - false - true - true - true - true - true - 7 true + true + false + false + false + false + true + 7 Sheet1 @@ -3098,7 +3105,7 @@ ???(???) - 0000.00.00, 00:00:00 + 0000.00.00, 00:00:00 @@ -3224,7 +3231,11 @@ Sales - + + + January + + @@ -3260,7 +3271,11 @@ 50 - + + + February + + @@ -3296,7 +3311,11 @@ 36 - + + + March + + @@ -3332,7 +3351,11 @@ 81 - + + + April + + @@ -3369,7 +3392,11 @@ 25 - + + + May + + @@ -3405,7 +3432,11 @@ 94 - + + + June + + @@ -3434,7 +3465,11 @@ 65 - + + + July + + @@ -3463,7 +3498,11 @@ 38 - + + + August + + @@ -3499,7 +3538,11 @@ 15 - + + + September + + @@ -3535,7 +3578,11 @@ 36 - + + + October + + @@ -3560,7 +3607,11 @@ 48 - + + + November + + @@ -3598,7 +3649,11 @@ 25 - + + + December + + @@ -3636,7 +3691,11 @@ 38 - + + + January + + @@ -3674,7 +3733,11 @@ 38 - + + + February + + @@ -3706,7 +3769,11 @@ 14 - + + + March + + @@ -3734,7 +3801,11 @@ 5 - + + + April + + @@ -3762,7 +3833,11 @@ 9 - + + + Mai + + @@ -3790,7 +3865,11 @@ 21 - + + + June + + @@ -3818,7 +3897,11 @@ 35 - + + + July + + @@ -3833,7 +3916,11 @@ {=XMATCH(K2:K10;K2:K10;)} - + + + August + + @@ -3848,7 +3935,11 @@ {=XMATCH(K2:K10;K2:K10;)} - + + + September + + @@ -3866,7 +3957,11 @@ - + + + October + + @@ -3903,7 +3998,11 @@ H - + + + November + + @@ -3918,7 +4017,11 @@ =XMATCH(G28;$G$23:$N$23) - + + + December + + @@ -4128,7 +4231,40 @@ - + + + 4 + + + 16 + + + IGAZ + + + =XMATCH("April";$Q$1:$Q$24;0;1) + + + Lookup cache test with neighbor cells + + + + + + 4 + + + 16 + + + IGAZ + + + =XMATCH("April";$Q$1:$Q$24;0;-1) + + + + diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 4b2e6f801161..79a91ed5ed6b 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -12149,7 +12149,7 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos, ScRange aLookupRange( rParam.nCol1, rParam.nRow1, rParam.nTab, rParam.nCol2, rParam.nRow2, rParam.nTab); ScLookupCache& rCache = mrDoc.GetLookupCache( aLookupRange, &mrContext ); - ScLookupCache::QueryCriteria aCriteria( rEntry ); + ScLookupCache::QueryCriteria aCriteria( rEntry, nSearchMode); ScLookupCache::Result eCacheResult = rCache.lookup( o_rResultPos, aCriteria, aPos); diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx index 70e19ec20d86..d4c19a3c7e07 100644 --- a/sc/source/core/tool/lookupcache.cxx +++ b/sc/source/core/tool/lookupcache.cxx @@ -24,8 +24,8 @@ #include -ScLookupCache::QueryCriteria::QueryCriteria( const ScQueryEntry& rEntry ) : - mfVal(0.0), mbAlloc(false), mbString(false) +ScLookupCache::QueryCriteria::QueryCriteria( const ScQueryEntry& rEntry, sal_Int8 nSearchMode ) : + mfVal(0.0), mbAlloc(false), mbString(false), meSearchMode(static_cast(nSearchMode)) { switch (rEntry.eOp) { @@ -54,7 +54,8 @@ ScLookupCache::QueryCriteria::QueryCriteria( const ScLookupCache::QueryCriteria mfVal( r.mfVal), mbAlloc( false), mbString( false), - meOp( r.meOp) + meOp( r.meOp), + meSearchMode( r.meSearchMode) { if (r.mbString && r.mpStr) { @@ -72,7 +73,7 @@ ScLookupCache::Result ScLookupCache::lookup( ScAddress & o_rResultAddress, const QueryCriteria & rCriteria, const ScAddress & rQueryAddress ) const { auto it( maQueryMap.find( QueryKey( rQueryAddress, - rCriteria.getQueryOp()))); + rCriteria.getQueryOp(), rCriteria.getSearchMode()))); if (it == maQueryMap.end()) return NOT_CACHED; const QueryCriteriaAndResult& rResult = (*it).second; @@ -102,7 +103,7 @@ bool ScLookupCache::insert( const ScAddress & rResultAddress, const QueryCriteria & rCriteria, const ScAddress & rQueryAddress, const bool bAvailable ) { - QueryKey aKey( rQueryAddress, rCriteria.getQueryOp()); + QueryKey aKey( rQueryAddress, rCriteria.getQueryOp(), rCriteria.getSearchMode() ); QueryCriteriaAndResult aResult( rCriteria, rResultAddress); if (!bAvailable) aResult.maAddress.SetRow(-1); -- cgit