Kaydet (Commit) a953fa1c authored tarafından Michael Meeks's avatar Michael Meeks

vlookup - optimize SC_EQUAL and NOT_EQUAL.

Also don't accept partial matches ie. CONTAINS != EQUAL,
for VLOOKUP even if document option "search criteria =, <>
for whole cells" is turned off.

This also adds a new spreadsheet test file vlookup2.fods
with the option "search criteria =,<> for whole cells" turned off,
with VLOOKUP test cases that ensures that partial matches are not
accepted.

Change-Id: Ib1f4781b216431546c3fd6967f22518e86abf36b
Reviewed-on: https://gerrit.libreoffice.org/52589Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst e43d13b6
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2600,6 +2600,11 @@ 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(
......@@ -2629,10 +2634,14 @@ 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment