sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods | 22 +++++++-------- sc/source/core/data/table3.cxx | 9 ------ sc/uiconfig/scalc/ui/optcalculatepage.ui | 2 - 3 files changed, 12 insertions(+), 21 deletions(-)
New commits: commit 8dec2a98ce29251936cd45ebf864a89ff767ee50 Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Nov 16 01:30:24 2021 +0100 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Nov 17 10:10:58 2021 +0100 revert "vlookup - optimize SC_EQUAL and NOT_EQUAL." (tdf#139612) That commit breaks lookup when the "Search criteria = and <> must apply to whole cells" option is disabled, as it enforces whole cell checking regardless of the option. Given that the option is enabled by default in LO ('SearchCriteria' in Calc.xcs) and it's what MSOffice does as well, and this default gives good performance regardless of the option, I don't understand the purpose of the commit. Possibly it was based on a document where somebody disabled the option and then indeed got worse performance. Solution: Don't do that :). This reverts the code parts of a953fa1c0f6a40a08859570516c511f3a841 . The test I've kept but switched to ensure that partial matching does work if the option to match whole cells is disabled. I've also changed the tooltip for the option to mention performance and not suggest that off is the default. Change-Id: I56d7b6e7b8e9f0622f7ad6d447daf56c3b705a7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125267 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods index d47779d928a1..fd228881a7cb 100644 --- a/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods +++ b/sc/qa/unit/data/functions/spreadsheet/fods/vlookup2.fods @@ -1017,14 +1017,14 @@ <text:p>TRUE</text:p> </table:table-cell> <table:table-cell office:value-type="string" calcext:value-type="string"> - <text:p>VLOOKUP tests that ensure there is no partial matching of cell contents</text:p> + <text:p>VLOOKUP tests that ensure there is partial matching of cell contents</text:p> </table:table-cell> </table:table-row> <table:table-row table:style-name="ro2"> <table:table-cell/> <table:table-cell table:style-name="ce8"/> <table:table-cell office:value-type="string" calcext:value-type="string"> - <text:p>even though the document option of “search on whole cell” is turned off.</text:p> + <text:p>when the document option of “search on whole cell” is turned off.</text:p> </table:table-cell> </table:table-row> <table:table-row table:style-name="ro2" table:number-rows-repeated="29"> @@ -1095,10 +1095,10 @@ <table:table-cell table:style-name="ce22" table:formula="of:=VLOOKUP("ABC";[.$L$2:.$M$5];2;0)" office:value-type="string" office:string-value="" calcext:value-type="error"> <text:p>#N/A</text:p> </table:table-cell> - <table:table-cell table:formula="of:=#N/A" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>#N/A</text:p> + <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> </table:table-cell> - <table:table-cell table:style-name="ce25" table:formula="of:=ISERROR([.A2])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <table:table-cell table:style-name="ce25" table:formula="of:=[.A2]=[.B2]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> <text:p>TRUE</text:p> </table:table-cell> <table:table-cell table:style-name="ce13" table:formula="of:=FORMULA([.A2])" office:value-type="string" office:string-value="=VLOOKUP("ABC",$L$2:$M$5,2,0)" calcext:value-type="string"> @@ -1122,10 +1122,10 @@ <table:table-cell table:formula="of:=VLOOKUP("BCD";[.$L$2:.$M$5];2;0)" office:value-type="string" office:string-value="" calcext:value-type="error"> <text:p>#N/A</text:p> </table:table-cell> - <table:table-cell table:formula="of:=#N/A" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>#N/A</text:p> + <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> </table:table-cell> - <table:table-cell table:style-name="ce25" table:formula="of:=ISERROR([.A3])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <table:table-cell table:style-name="ce25" table:formula="of:=[.A3]=[.B3]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> <text:p>TRUE</text:p> </table:table-cell> <table:table-cell table:style-name="ce13" table:formula="of:=FORMULA([.A3])" office:value-type="string" office:string-value="=VLOOKUP("BCD",$L$2:$M$5,2,0)" calcext:value-type="string"> @@ -1149,10 +1149,10 @@ <table:table-cell table:formula="of:=VLOOKUP("BC";[.$L$2:.$M$5];2;0)" office:value-type="string" office:string-value="" calcext:value-type="error"> <text:p>#N/A</text:p> </table:table-cell> - <table:table-cell table:formula="of:=#N/A" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>#N/A</text:p> + <table:table-cell office:value-type="float" office:value="2" calcext:value-type="float"> + <text:p>2</text:p> </table:table-cell> - <table:table-cell table:style-name="ce25" table:formula="of:=ISERROR([.A4])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <table:table-cell table:style-name="ce25" table:formula="of:=[.A4]=[.B4]" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> <text:p>TRUE</text:p> </table:table-cell> <table:table-cell table:style-name="ce13" table:formula="of:=FORMULA([.A4])" office:value-type="string" office:string-value="=VLOOKUP("BC",$L$2:$M$5,2,0)" calcext:value-type="string"> diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 9c7417278658..0ef833511dba 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -2767,11 +2767,6 @@ public: if (nIndex < 0) nStrPos = -1; - else if (rEntry.eOp == SC_EQUAL || - rEntry.eOp == SC_NOT_EQUAL) - { - nStrPos = pCellStr == pQuer ? 0 : -1; - } else { // OUString::indexOf nStrPos = rtl_ustr_indexOfStr_WithLength( @@ -2803,14 +2798,10 @@ public: switch (rEntry.eOp) { case SC_EQUAL: - bOk = ( nStrPos == 0 ); - break; case SC_CONTAINS: bOk = ( nStrPos != -1 ); break; case SC_NOT_EQUAL: - bOk = ( nStrPos != 0 ); - break; case SC_DOES_NOT_CONTAIN: bOk = ( nStrPos == -1 ); break; diff --git a/sc/uiconfig/scalc/ui/optcalculatepage.ui b/sc/uiconfig/scalc/ui/optcalculatepage.ui index 1af846f48ff1..1c0c7f3c2928 100644 --- a/sc/uiconfig/scalc/ui/optcalculatepage.ui +++ b/sc/uiconfig/scalc/ui/optcalculatepage.ui @@ -131,7 +131,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> - <property name="tooltip_text" translatable="yes" context="optcalculatepage|match|tooltip_text">Enable this for interoperability with Microsoft Excel</property> + <property name="tooltip_text" translatable="yes" context="optcalculatepage|match|tooltip_text">Keep this enabled for interoperability with Microsoft Excel or for better performance</property> <property name="use_underline">True</property> <property name="draw_indicator">True</property> <child internal-child="accessible">