Lines 1011-1023
Link Here
|
1011 |
break; |
1011 |
break; |
1012 |
} |
1012 |
} |
1013 |
} |
1013 |
} |
1014 |
else if ( (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) || |
1014 |
else if ( (rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || |
|
|
1015 |
rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || |
1016 |
rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) || |
1015 |
(rEntry.bQueryByString && (pCell ? pCell->HasStringData() : |
1017 |
(rEntry.bQueryByString && (pCell ? pCell->HasStringData() : |
1016 |
HasStringData( |
1018 |
HasStringData( |
1017 |
static_cast<SCCOL>(rEntry.nField), |
1019 |
static_cast<SCCOL>(rEntry.nField), |
1018 |
nRow)))) |
1020 |
nRow)))) |
1019 |
{ // by String |
1021 |
{ // by String |
1020 |
String aCellStr; |
1022 |
String aCellStr; |
|
|
1023 |
|
1024 |
// Contains and Does not contain is similar to EQUAL and NOT EQUAL |
1025 |
// but with bMatchWholeCell set to false |
1026 |
if( rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || |
1027 |
rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH ) |
1028 |
bMatchWholeCell = FALSE; |
1029 |
|
1021 |
if ( pCell ) |
1030 |
if ( pCell ) |
1022 |
{ |
1031 |
{ |
1023 |
if (pCell->GetCellType() != CELLTYPE_NOTE) |
1032 |
if (pCell->GetCellType() != CELLTYPE_NOTE) |
Lines 1030-1036
Link Here
|
1030 |
GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); |
1039 |
GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); |
1031 |
|
1040 |
|
1032 |
BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) |
1041 |
BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) |
1033 |
|| (rEntry.eOp == SC_NOT_EQUAL))); |
1042 |
|| (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) |
|
|
1043 |
|| (rEntry.eOp == SC_DOES_NOT_CONTAIN) || (rEntry.eOp == SC_BEGINS_WITH) |
1044 |
|| (rEntry.eOp == SC_ENDS_WITH))); |
1034 |
BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp |
1045 |
BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp |
1035 |
&& ((rEntry.eOp == SC_LESS_EQUAL) |
1046 |
&& ((rEntry.eOp == SC_LESS_EQUAL) |
1036 |
|| (rEntry.eOp == SC_GREATER_EQUAL))); |
1047 |
|| (rEntry.eOp == SC_GREATER_EQUAL))); |
Lines 1041-1057
Link Here
|
1041 |
BOOL bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) |
1052 |
BOOL bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens ) |
1042 |
->SearchFrwrd( aCellStr, &nStart, &nEnd ); |
1053 |
->SearchFrwrd( aCellStr, &nStart, &nEnd ); |
1043 |
// from 614 on, nEnd is behind the found text |
1054 |
// from 614 on, nEnd is behind the found text |
1044 |
if ( bMatch && bMatchWholeCell |
1055 |
if ( bMatch ) |
1045 |
&& (nStart != 0 || nEnd != aCellStr.Len()) ) |
1056 |
{ |
1046 |
bMatch = FALSE; // RegExp must match entire cell string |
1057 |
if ( bMatchWholeCell && (nStart != 0 || nEnd != aCellStr.Len()) ) |
|
|
1058 |
bMatch = FALSE; // RegExp must match entire cell string |
1059 |
else if ( ( rEntry.eOp == SC_BEGINS_WITH && nStart != 0 ) || |
1060 |
( rEntry.eOp == SC_ENDS_WITH && nEnd != aCellStr.Len()-1 ) ) |
1061 |
bMatch = FALSE; |
1062 |
} |
1047 |
if ( bRealRegExp ) |
1063 |
if ( bRealRegExp ) |
1048 |
bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch); |
1064 |
bOk = ( ( rEntry.eOp == SC_NOT_EQUAL || |
|
|
1065 |
rEntry.eOp == SC_DOES_NOT_CONTAIN ) ? !bMatch : bMatch ); |
1049 |
else |
1066 |
else |
1050 |
bTestEqual = bMatch; |
1067 |
bTestEqual = bMatch; |
1051 |
} |
1068 |
} |
1052 |
if ( !bRealRegExp ) |
1069 |
if ( !bRealRegExp ) |
1053 |
{ |
1070 |
{ |
1054 |
if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL ) |
1071 |
if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL || |
|
|
1072 |
rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || |
1073 |
rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH ) |
1055 |
{ |
1074 |
{ |
1056 |
if ( !rEntry.bQueryByString && rEntry.pStr->Len() == 0 ) |
1075 |
if ( !rEntry.bQueryByString && rEntry.pStr->Len() == 0 ) |
1057 |
{ |
1076 |
{ |
Lines 1071-1079
Link Here
|
1071 |
String aQuer( pTransliteration->transliterate( |
1090 |
String aQuer( pTransliteration->transliterate( |
1072 |
*rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(), |
1091 |
*rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(), |
1073 |
&xOff ) ); |
1092 |
&xOff ) ); |
1074 |
bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND); |
1093 |
xub_StrLen nPos = aCell.Search( aQuer ); |
|
|
1094 |
bOk = ( nPos != STRING_NOTFOUND ); |
1095 |
if ( bOk ) |
1096 |
if ( rEntry.eOp == SC_BEGINS_WITH && nPos != 0 || |
1097 |
rEntry.eOp == SC_ENDS_WITH && nPos != aCell.Len()-aQuer.Len()-1 ) |
1098 |
bOk = FALSE; |
1075 |
} |
1099 |
} |
1076 |
if ( rEntry.eOp == SC_NOT_EQUAL ) |
1100 |
if ( rEntry.eOp == SC_NOT_EQUAL || |
|
|
1101 |
rEntry.eOp == SC_DOES_NOT_CONTAIN ) |
1077 |
bOk = !bOk; |
1102 |
bOk = !bOk; |
1078 |
} |
1103 |
} |
1079 |
else |
1104 |
else |