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

(-)sc/inc/global.hxx (-1 / +5 lines)
Lines 818-824 enum ScQueryOp Link Here
818
		SC_TOPVAL,
818
		SC_TOPVAL,
819
		SC_BOTVAL,
819
		SC_BOTVAL,
820
		SC_TOPPERC,
820
		SC_TOPPERC,
821
		SC_BOTPERC
821
		SC_BOTPERC,
822
		SC_CONTAINS,
823
		SC_DOES_NOT_CONTAIN,
824
		SC_BEGINS_WITH,
825
		SC_ENDS_WITH
822
	};
826
	};
823
827
824
// -----------------------------------------------------------------------
828
// -----------------------------------------------------------------------
(-)sc/source/ui/src/filter.src (-6 / +18 lines)
Lines 180-195 ModelessDialog RID_SCDLG_FILTER Link Here
180
		};
180
		};
181
		stringlist [ en-US ] =
181
		stringlist [ en-US ] =
182
		{
182
		{
183
			< "=" ; Default ; > ;
183
                        < "Equals" ; Default ; > ;
184
			< "<" ; Default ; > ;
184
			< "<" ; Default ; > ;
185
			< ">" ; Default ; > ;
185
			< ">" ; Default ; > ;
186
			< "<=" ; Default ; > ;
186
			< "<=" ; Default ; > ;
187
			< ">=" ; Default ; > ;
187
			< ">=" ; Default ; > ;
188
			< "<>" ; Default ; > ;
188
                        < "Not equals" ; Default ; > ;
189
			< "Largest" ; Default ; > ;
189
			< "Largest" ; Default ; > ;
190
			< "Smallest" ; Default ; > ;
190
			< "Smallest" ; Default ; > ;
191
			< "Largest %" ; Default ; > ;
191
			< "Largest %" ; Default ; > ;
192
			< "Smallest %" ; Default ; > ;
192
			< "Smallest %" ; Default ; > ;
193
			< "Contains" ; Default ; > ;
194
			< "Does not Contain" ; Default ; > ;
195
                        < "Begins with" ; Default ; > ;
196
                        < "Ends with" ; Default ; > ;
193
		};
197
		};
194
	};
198
	};
195
	ListBox LB_COND2
199
	ListBox LB_COND2
Lines 214-229 ModelessDialog RID_SCDLG_FILTER Link Here
214
		};
218
		};
215
		stringlist [ en-US ] =
219
		stringlist [ en-US ] =
216
		{
220
		{
217
			< "=" ; Default ; > ;
221
                        < "Equals" ; Default ; > ;
218
			< "<" ; Default ; > ;
222
			< "<" ; Default ; > ;
219
			< ">" ; Default ; > ;
223
			< ">" ; Default ; > ;
220
			< "<=" ; Default ; > ;
224
			< "<=" ; Default ; > ;
221
			< ">=" ; Default ; > ;
225
			< ">=" ; Default ; > ;
222
			< "<>" ; Default ; > ;
226
			< "Not equals" ; Default ; > ;
223
			< "Largest" ; Default ; > ;
227
			< "Largest" ; Default ; > ;
224
			< "Smallest" ; Default ; > ;
228
			< "Smallest" ; Default ; > ;
225
			< "Largest %" ; Default ; > ;
229
			< "Largest %" ; Default ; > ;
226
			< "Smallest %" ; Default ; > ;
230
			< "Smallest %" ; Default ; > ;
231
			< "Contains" ; Default ; > ;
232
			< "Does not Contain" ; Default ; > ;
233
                        < "Begins with" ; Default ; > ;
234
                        < "Ends with" ; Default ; > ;
227
		};
235
		};
228
	};
236
	};
229
	ListBox LB_COND3
237
	ListBox LB_COND3
Lines 248-263 ModelessDialog RID_SCDLG_FILTER Link Here
248
		};
256
		};
249
		stringlist [ en-US ] =
257
		stringlist [ en-US ] =
250
		{
258
		{
251
			< "=" ; Default ; > ;
259
                        < "Equals" ; Default ; > ;
252
			< "<" ; Default ; > ;
260
			< "<" ; Default ; > ;
253
			< ">" ; Default ; > ;
261
			< ">" ; Default ; > ;
254
			< "<=" ; Default ; > ;
262
			< "<=" ; Default ; > ;
255
			< ">=" ; Default ; > ;
263
			< ">=" ; Default ; > ;
256
			< "<>" ; Default ; > ;
264
			< "Not equals" ; Default ; > ;
257
			< "Largest" ; Default ; > ;
265
			< "Largest" ; Default ; > ;
258
			< "Smallest" ; Default ; > ;
266
			< "Smallest" ; Default ; > ;
259
			< "Largest %" ; Default ; > ;
267
			< "Largest %" ; Default ; > ;
260
			< "Smallest %" ; Default ; > ;
268
			< "Smallest %" ; Default ; > ;
269
			< "Contains" ; Default ; > ;
270
			< "Does not Contain" ; Default ; > ;
271
                        < "Begins with" ; Default ; > ;
272
                        < "Ends with" ; Default ; > ;
261
		};
273
		};
262
	};
274
	};
263
	ComboBox ED_VAL1
275
	ComboBox ED_VAL1
(-)sc/source/ui/dbgui/filtdlg.cxx (-1 / +16 lines)
Lines 84-89 Link Here
84
#include "document.hxx"
84
#include "document.hxx"
85
#include "docsh.hxx"
85
#include "docsh.hxx"
86
#include "scresid.hxx"
86
#include "scresid.hxx"
87
#include "docoptio.hxx"
87
88
88
#include "foptmgr.hxx"
89
#include "foptmgr.hxx"
89
90
Lines 572-577 ScQueryItem* ScFilterDlg::GetOutputItem( Link Here
572
		bCopyPosOk = ( SCA_VALID == (nResult & SCA_VALID) );
573
		bCopyPosOk = ( SCA_VALID == (nResult & SCA_VALID) );
573
	}
574
	}
574
575
576
	theParam.bRegExp                = aBtnRegExp.IsChecked();
577
575
	for ( i = 0; i < 3; i++ )
578
	for ( i = 0; i < 3; i++ )
576
	{
579
	{
577
		USHORT 		nField	= aFieldLbArr[i]->GetSelectEntryPos();
580
		USHORT 		nField	= aFieldLbArr[i]->GetSelectEntryPos();
Lines 605-610 ScQueryItem* ScFilterDlg::GetOutputItem( Link Here
605
			}
608
			}
606
			else
609
			else
607
			{
610
			{
611
				if (eOp == SC_BEGINS_WITH ) {
612
					String tmp ('^');
613
					tmp .Append(aStrVal);
614
					::rtl::OUString str (tmp);
615
					aStrVal.Assign(tmp);
616
					theParam.bRegExp		= TRUE;
617
				}
618
				else if (eOp == SC_ENDS_WITH ) {
619
					aStrVal.Append (String('$'));
620
					theParam.bRegExp		= TRUE;
621
				}
622
608
				*rEntry.pStr		  = aStrVal;
623
				*rEntry.pStr		  = aStrVal;
609
				rEntry.nVal			  = 0;
624
				rEntry.nVal			  = 0;
610
				rEntry.bQueryByString = TRUE;
625
				rEntry.bQueryByString = TRUE;
Lines 642-648 ScQueryItem* ScFilterDlg::GetOutputItem( Link Here
642
	theParam.bByRow			= TRUE;
657
	theParam.bByRow			= TRUE;
643
	theParam.bDuplicate		= !aBtnUnique.IsChecked();
658
	theParam.bDuplicate		= !aBtnUnique.IsChecked();
644
	theParam.bCaseSens 		= aBtnCase.IsChecked();
659
	theParam.bCaseSens 		= aBtnCase.IsChecked();
645
	theParam.bRegExp		= aBtnRegExp.IsChecked();
660
	
646
	theParam.bDestPers		= aBtnDestPers.IsChecked();
661
	theParam.bDestPers		= aBtnDestPers.IsChecked();
647
662
648
	//	nur die drei eingestellten - alles andere zuruecksetzen
663
	//	nur die drei eingestellten - alles andere zuruecksetzen
(-)sc/source/core/data/table3.cxx (-5 / +20 lines)
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

Return to issue 35579