Lines 1037-1049
BOOL ScTable::ValidQuery(SCROW nRow, con
Link Here
|
1037 |
break; |
1037 |
break; |
1038 |
} |
1038 |
} |
1039 |
} |
1039 |
} |
1040 |
else if ( (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) || |
1040 |
else if ( (rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || |
|
|
1041 |
rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || |
1042 |
rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) || |
1041 |
(rEntry.bQueryByString && (pCell ? pCell->HasStringData() : |
1043 |
(rEntry.bQueryByString && (pCell ? pCell->HasStringData() : |
1042 |
HasStringData( |
1044 |
HasStringData( |
1043 |
static_cast<SCCOL>(rEntry.nField), |
1045 |
static_cast<SCCOL>(rEntry.nField), |
1044 |
nRow)))) |
1046 |
nRow)))) |
1045 |
{ // by String |
1047 |
{ // by String |
1046 |
String aCellStr; |
1048 |
String aCellStr; |
|
|
1049 |
|
1050 |
// Contains and Does not contain is similar to EQUAL and NOT EQUAL |
1051 |
// but with bMatchWholeCell set to false |
1052 |
if(rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_BEGINS_WITH || |
1053 |
rEntry.eOp == SC_ENDS_WITH || rEntry.eOp == SC_DOES_NOT_CONTAIN) |
1054 |
bMatchWholeCell = FALSE; |
1055 |
|
1047 |
if ( pCell ) |
1056 |
if ( pCell ) |
1048 |
{ |
1057 |
{ |
1049 |
if (pCell->GetCellType() != CELLTYPE_NOTE) |
1058 |
if (pCell->GetCellType() != CELLTYPE_NOTE) |
Lines 1056-1062
BOOL ScTable::ValidQuery(SCROW nRow, con
Link Here
|
1056 |
GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); |
1065 |
GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr ); |
1057 |
|
1066 |
|
1058 |
BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) |
1067 |
BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL) |
1059 |
|| (rEntry.eOp == SC_NOT_EQUAL))); |
1068 |
|| (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) |
|
|
1069 |
|| (rEntry.eOp == SC_DOES_NOT_CONTAIN) || (rEntry.eOp == SC_BEGINS_WITH) |
1070 |
|| (rEntry.eOp == SC_ENDS_WITH))); |
1060 |
BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp |
1071 |
BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp |
1061 |
&& ((rEntry.eOp == SC_LESS_EQUAL) |
1072 |
&& ((rEntry.eOp == SC_LESS_EQUAL) |
1062 |
|| (rEntry.eOp == SC_GREATER_EQUAL))); |
1073 |
|| (rEntry.eOp == SC_GREATER_EQUAL))); |
Lines 1071-1083
BOOL ScTable::ValidQuery(SCROW nRow, con
Link Here
|
1071 |
&& (nStart != 0 || nEnd != aCellStr.Len()) ) |
1082 |
&& (nStart != 0 || nEnd != aCellStr.Len()) ) |
1072 |
bMatch = FALSE; // RegExp must match entire cell string |
1083 |
bMatch = FALSE; // RegExp must match entire cell string |
1073 |
if ( bRealRegExp ) |
1084 |
if ( bRealRegExp ) |
1074 |
bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch); |
1085 |
bOk = ((rEntry.eOp == SC_NOT_EQUAL || |
|
|
1086 |
rEntry.eOp == SC_DOES_NOT_CONTAIN) ? !bMatch : bMatch); |
1075 |
else |
1087 |
else |
1076 |
bTestEqual = bMatch; |
1088 |
bTestEqual = bMatch; |
1077 |
} |
1089 |
} |
1078 |
if ( !bRealRegExp ) |
1090 |
if ( !bRealRegExp ) |
1079 |
{ |
1091 |
{ |
1080 |
if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL ) |
1092 |
if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL |
|
|
1093 |
|| rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN |
1094 |
|| rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH) |
1081 |
{ |
1095 |
{ |
1082 |
if ( !rEntry.bQueryByString && rEntry.pStr->Len() == 0 ) |
1096 |
if ( !rEntry.bQueryByString && rEntry.pStr->Len() == 0 ) |
1083 |
{ |
1097 |
{ |
Lines 1099-1105
BOOL ScTable::ValidQuery(SCROW nRow, con
Link Here
|
1099 |
&xOff ) ); |
1113 |
&xOff ) ); |
1100 |
bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND); |
1114 |
bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND); |
1101 |
} |
1115 |
} |
1102 |
if ( rEntry.eOp == SC_NOT_EQUAL ) |
1116 |
if ( rEntry.eOp == SC_NOT_EQUAL || |
|
|
1117 |
rEntry.eOp == SC_DOES_NOT_CONTAIN) |
1103 |
bOk = !bOk; |
1118 |
bOk = !bOk; |
1104 |
} |
1119 |
} |
1105 |
else |
1120 |
else |