View | Details | Raw Unified | Return to issue 35579
Collapse All | Expand All

(-)sc/inc/global.hxx (-1 / +5 lines)
Lines 804-810 Link Here
804
		SC_TOPVAL,
804
		SC_TOPVAL,
805
		SC_BOTVAL,
805
		SC_BOTVAL,
806
		SC_TOPPERC,
806
		SC_TOPPERC,
807
		SC_BOTPERC
807
		SC_BOTPERC,
808
		SC_CONTAINS,
809
		SC_DOES_NOT_CONTAIN,
810
		SC_BEGINS_WITH,
811
		SC_ENDS_WITH
808
	};
812
	};
809
813
810
// -----------------------------------------------------------------------
814
// -----------------------------------------------------------------------
(-)sc/source/core/data/table3.cxx (-9 / +34 lines)
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
(-)sc/source/ui/src/filter.src (-6 / +18 lines)
Lines 154-169 Link Here
154
		};
154
		};
155
		stringlist [ en-US ] =
155
		stringlist [ en-US ] =
156
		{
156
		{
157
			< "=" ; Default ; > ;
157
			< "Equals" ; Default ; > ;
158
			< "<" ; Default ; > ;
158
			< "<" ; Default ; > ;
159
			< ">" ; Default ; > ;
159
			< ">" ; Default ; > ;
160
			< "<=" ; Default ; > ;
160
			< "<=" ; Default ; > ;
161
			< ">=" ; Default ; > ;
161
			< ">=" ; Default ; > ;
162
			< "<>" ; Default ; > ;
162
			< "Not equals" ; Default ; > ;
163
			< "Largest" ; Default ; > ;
163
			< "Largest" ; Default ; > ;
164
			< "Smallest" ; Default ; > ;
164
			< "Smallest" ; Default ; > ;
165
			< "Largest %" ; Default ; > ;
165
			< "Largest %" ; Default ; > ;
166
			< "Smallest %" ; Default ; > ;
166
			< "Smallest %" ; Default ; > ;
167
			< "Contains" ; Default ; > ;
168
			< "Does not Contain" ; Default ; > ;
169
			< "Begins with" ; Default ; > ;
170
			< "Ends with" ; Default ; > ;
167
		};
171
		};
168
	};
172
	};
169
	ListBox LB_COND2
173
	ListBox LB_COND2
Lines 188-203 Link Here
188
		};
192
		};
189
		stringlist [ en-US ] =
193
		stringlist [ en-US ] =
190
		{
194
		{
191
			< "=" ; Default ; > ;
195
			< "Equals" ; Default ; > ;
192
			< "<" ; Default ; > ;
196
			< "<" ; Default ; > ;
193
			< ">" ; Default ; > ;
197
			< ">" ; Default ; > ;
194
			< "<=" ; Default ; > ;
198
			< "<=" ; Default ; > ;
195
			< ">=" ; Default ; > ;
199
			< ">=" ; Default ; > ;
196
			< "<>" ; Default ; > ;
200
			< "Not equals" ; Default ; > ;
197
			< "Largest" ; Default ; > ;
201
			< "Largest" ; Default ; > ;
198
			< "Smallest" ; Default ; > ;
202
			< "Smallest" ; Default ; > ;
199
			< "Largest %" ; Default ; > ;
203
			< "Largest %" ; Default ; > ;
200
			< "Smallest %" ; Default ; > ;
204
			< "Smallest %" ; Default ; > ;
205
			< "Contains" ; Default ; > ;
206
			< "Does not Contain" ; Default ; > ;
207
			< "Begins with" ; Default ; > ;
208
			< "Ends with" ; Default ; > ;
201
		};
209
		};
202
	};
210
	};
203
	ListBox LB_COND3
211
	ListBox LB_COND3
Lines 222-237 Link Here
222
		};
230
		};
223
		stringlist [ en-US ] =
231
		stringlist [ en-US ] =
224
		{
232
		{
225
			< "=" ; Default ; > ;
233
			< "Equals" ; Default ; > ;
226
			< "<" ; Default ; > ;
234
			< "<" ; Default ; > ;
227
			< ">" ; Default ; > ;
235
			< ">" ; Default ; > ;
228
			< "<=" ; Default ; > ;
236
			< "<=" ; Default ; > ;
229
			< ">=" ; Default ; > ;
237
			< ">=" ; Default ; > ;
230
			< "<>" ; Default ; > ;
238
			< "Not equals" ; Default ; > ;
231
			< "Largest" ; Default ; > ;
239
			< "Largest" ; Default ; > ;
232
			< "Smallest" ; Default ; > ;
240
			< "Smallest" ; Default ; > ;
233
			< "Largest %" ; Default ; > ;
241
			< "Largest %" ; Default ; > ;
234
			< "Smallest %" ; Default ; > ;
242
			< "Smallest %" ; Default ; > ;
243
			< "Contains" ; Default ; > ;
244
			< "Does not Contain" ; Default ; > ;
245
			< "Begins with" ; Default ; > ;
246
			< "Ends with" ; Default ; > ;
235
		};
247
		};
236
	};
248
	};
237
	ComboBox ED_VAL1
249
	ComboBox ED_VAL1

Return to issue 35579