Kaydet (Commit) 9e2e9453 authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#89958 filter ends with / does not end with correction

Regression of 8850633f String to
OUString and xub_StrLen to sal_Int32 conversion, it worked by accident
only anyway..

Change-Id: Id6fea7075949b98e58294d9fdaae4313f69f9b55
üst 7edd92c5
......@@ -2509,9 +2509,9 @@ public:
OUString aQuer( mpTransliteration->transliterate(
aQueryStr, ScGlobal::eLnge, 0, aQueryStr.getLength(),
NULL ) );
sal_Int32 nIndex = (rEntry.eOp == SC_ENDS_WITH
|| rEntry.eOp == SC_DOES_NOT_END_WITH) ? (aCell.getLength()-aQuer.getLength()) : 0;
sal_Int32 nStrPos = aCell.indexOf( aQuer, nIndex );
sal_Int32 nIndex = (rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_END_WITH) ?
(aCell.getLength() - aQuer.getLength()) : 0;
sal_Int32 nStrPos = ((nIndex < 0) ? -1 : aCell.indexOf( aQuer, nIndex ));
switch (rEntry.eOp)
{
case SC_EQUAL:
......@@ -2529,10 +2529,10 @@ public:
bOk = ( nStrPos != 0 );
break;
case SC_ENDS_WITH:
bOk = ( nStrPos + aQuer.getLength() == aCell.getLength() );
bOk = (nStrPos >= 0 && nStrPos + aQuer.getLength() == aCell.getLength() );
break;
case SC_DOES_NOT_END_WITH:
bOk = ( nStrPos + aQuer.getLength() != aCell.getLength() );
bOk = (nStrPos < 0 || nStrPos + aQuer.getLength() != aCell.getLength() );
break;
default:
{
......
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