Index: sc/inc/global.hxx
===================================================================
RCS file: /cvs/sc/sc/inc/global.hxx,v
retrieving revision 1.42
diff -u -p -u -r1.42 global.hxx
--- sc/inc/global.hxx	13 Jan 2005 17:21:00 -0000	1.42
+++ sc/inc/global.hxx	11 Apr 2005 11:36:29 -0000
@@ -818,7 +818,11 @@ enum ScQueryOp
 		SC_TOPVAL,
 		SC_BOTVAL,
 		SC_TOPPERC,
-		SC_BOTPERC
+		SC_BOTPERC,
+		SC_CONTAINS,
+		SC_DOES_NOT_CONTAIN,
+		SC_BEGINS_WITH,
+		SC_ENDS_WITH
 	};
 
 // -----------------------------------------------------------------------
Index: sc/source/ui/src/filter.src
===================================================================
RCS file: /cvs/sc/sc/source/ui/src/filter.src,v
retrieving revision 1.54
diff -u -p -u -r1.54 filter.src
--- sc/source/ui/src/filter.src	18 Mar 2005 15:17:32 -0000	1.54
+++ sc/source/ui/src/filter.src	11 Apr 2005 11:36:29 -0000
@@ -151,19 +151,27 @@ ModelessDialog RID_SCDLG_FILTER
 			< "kleinste" ; Default ; > ;
 			< "größte %" ; Default ; > ;
 			< "kleinste %" ; Default ; > ;
+			< "Enthält" ; Default ; > ;
+			< "Enthält nicht" ; Default ; > ;
+                        < "Beginnt mit" ; Default ; > ;
+                        < "Endet mit" ; Default ; > ;
 		};
 		stringlist [ en-US ] =
 		{
-			< "=" ; Default ; > ;
+                        < "Equals" ; Default ; > ;
 			< "<" ; Default ; > ;
 			< ">" ; Default ; > ;
 			< "<=" ; Default ; > ;
 			< ">=" ; Default ; > ;
-			< "<>" ; Default ; > ;
+                        < "Not equals" ; Default ; > ;
 			< "Largest" ; Default ; > ;
 			< "Smallest" ; Default ; > ;
 			< "Largest %" ; Default ; > ;
 			< "Smallest %" ; Default ; > ;
+			< "Contains" ; Default ; > ;
+			< "Does not Contain" ; Default ; > ;
+                        < "Begins with" ; Default ; > ;
+                        < "Ends with" ; Default ; > ;
 		};
 	};
 	ListBox LB_COND2
@@ -185,19 +193,27 @@ ModelessDialog RID_SCDLG_FILTER
 			< "kleinste" ; Default ; > ;
 			< "größte %" ; Default ; > ;
 			< "kleinste %" ; Default ; > ;
+			< "Enthält" ; Default ; > ;
+			< "Enthält nicht" ; Default ; > ;
+                        < "Beginnt mit" ; Default ; > ;
+                        < "Endet mit" ; Default ; > ;
 		};
 		stringlist [ en-US ] =
 		{
-			< "=" ; Default ; > ;
+                        < "Equals" ; Default ; > ;
 			< "<" ; Default ; > ;
 			< ">" ; Default ; > ;
 			< "<=" ; Default ; > ;
 			< ">=" ; Default ; > ;
-			< "<>" ; Default ; > ;
+			< "Not equals" ; Default ; > ;
 			< "Largest" ; Default ; > ;
 			< "Smallest" ; Default ; > ;
 			< "Largest %" ; Default ; > ;
 			< "Smallest %" ; Default ; > ;
+			< "Contains" ; Default ; > ;
+			< "Does not Contain" ; Default ; > ;
+                        < "Begins with" ; Default ; > ;
+                        < "Ends with" ; Default ; > ;
 		};
 	};
 	ListBox LB_COND3
@@ -219,19 +235,27 @@ ModelessDialog RID_SCDLG_FILTER
 			< "kleinste" ; Default ; > ;
 			< "größte %" ; Default ; > ;
 			< "kleinste %" ; Default ; > ;
+			< "Enthält" ; Default ; > ;
+			< "Enthält nicht" ; Default ; > ;
+                        < "Beginnt mit" ; Default ; > ;
+                        < "Endet mit" ; Default ; > ;
 		};
 		stringlist [ en-US ] =
 		{
-			< "=" ; Default ; > ;
+                        < "Equals" ; Default ; > ;
 			< "<" ; Default ; > ;
 			< ">" ; Default ; > ;
 			< "<=" ; Default ; > ;
 			< ">=" ; Default ; > ;
-			< "<>" ; Default ; > ;
+			< "Not equals" ; Default ; > ;
 			< "Largest" ; Default ; > ;
 			< "Smallest" ; Default ; > ;
 			< "Largest %" ; Default ; > ;
 			< "Smallest %" ; Default ; > ;
+			< "Contains" ; Default ; > ;
+			< "Does not Contain" ; Default ; > ;
+                        < "Begins with" ; Default ; > ;
+                        < "Ends with" ; Default ; > ;
 		};
 	};
 	ComboBox ED_VAL1
Index: sc/source/core/data/table3.cxx
===================================================================
RCS file: /cvs/sc/sc/source/core/data/table3.cxx,v
retrieving revision 1.21
diff -u -u -B -r1.21 table3.cxx
--- sc/source/core/data/table3.cxx	8 Sep 2005 18:30:49 -0000	1.21
+++ sc/source/core/data/table3.cxx	12 Feb 2006 09:39:45 -0000
@@ -1011,13 +1011,22 @@
 					break;
 			}
 		}
-        else if ( (rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) ||
+        else if ( (rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN || 
+		rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH || 
+		rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL) ||
                 (rEntry.bQueryByString && (pCell ? pCell->HasStringData() :
                                            HasStringData(
                                                static_cast<SCCOL>(rEntry.nField),
                                                nRow))))
 		{	// by String
 			String	aCellStr;
+
+			// Contains and Does not contain is similar to EQUAL and NOT EQUAL
+			// but with bMatchWholeCell set to false
+			if( rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN ||
+				rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH )
+				bMatchWholeCell = FALSE;
+
             if ( pCell )
             {
                 if (pCell->GetCellType() != CELLTYPE_NOTE)
@@ -1030,7 +1039,9 @@
                 GetInputString( static_cast<SCCOL>(rEntry.nField), nRow, aCellStr );
 
             BOOL bRealRegExp = (rParam.bRegExp && ((rEntry.eOp == SC_EQUAL)
-                || (rEntry.eOp == SC_NOT_EQUAL)));
+                || (rEntry.eOp == SC_NOT_EQUAL) || (rEntry.eOp == SC_CONTAINS) 
+				|| (rEntry.eOp == SC_DOES_NOT_CONTAIN) || (rEntry.eOp == SC_BEGINS_WITH)
+				|| (rEntry.eOp == SC_ENDS_WITH)));
             BOOL bTestRegExp = (pbTestEqualCondition && rParam.bRegExp
                 && ((rEntry.eOp == SC_LESS_EQUAL)
                     || (rEntry.eOp == SC_GREATER_EQUAL)));
@@ -1041,17 +1052,25 @@
                 BOOL bMatch = (BOOL) rEntry.GetSearchTextPtr( rParam.bCaseSens )
 					->SearchFrwrd( aCellStr, &nStart, &nEnd );
 				// from 614 on, nEnd is behind the found text
-                if ( bMatch && bMatchWholeCell
-						&& (nStart != 0 || nEnd != aCellStr.Len()) )
-                    bMatch = FALSE;    // RegExp must match entire cell string
+                if ( bMatch )
+				{
+					if ( bMatchWholeCell && (nStart != 0 || nEnd != aCellStr.Len()) )
+						bMatch = FALSE;    // RegExp must match entire cell string
+					else if ( ( rEntry.eOp == SC_BEGINS_WITH && nStart != 0 ) ||
+							  ( rEntry.eOp == SC_ENDS_WITH && nEnd != aCellStr.Len()-1 ) )
+						bMatch = FALSE;
+				}
                 if ( bRealRegExp )
-                    bOk = ((rEntry.eOp == SC_NOT_EQUAL) ? !bMatch : bMatch);
+                    bOk = ( ( rEntry.eOp == SC_NOT_EQUAL || 
+							rEntry.eOp == SC_DOES_NOT_CONTAIN ) ? !bMatch : bMatch );
                 else
                     bTestEqual = bMatch;
             }
             if ( !bRealRegExp )
 			{
-				if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL )
+				if ( rEntry.eOp == SC_EQUAL || rEntry.eOp == SC_NOT_EQUAL || 
+					 rEntry.eOp == SC_CONTAINS || rEntry.eOp == SC_DOES_NOT_CONTAIN ||
+					 rEntry.eOp == SC_BEGINS_WITH || rEntry.eOp == SC_ENDS_WITH )
 				{
                     if ( !rEntry.bQueryByString && rEntry.pStr->Len() == 0 )
                     {
@@ -1071,9 +1090,15 @@
                         String aQuer( pTransliteration->transliterate(
                             *rEntry.pStr, ScGlobal::eLnge, 0, rEntry.pStr->Len(),
                             &xOff ) );
-                        bOk = (aCell.Search( aQuer ) != STRING_NOTFOUND);
+						xub_StrLen nPos = aCell.Search( aQuer );
+                        bOk = ( nPos != STRING_NOTFOUND );
+						if ( bOk )
+							if ( rEntry.eOp == SC_BEGINS_WITH && nPos != 0 || 
+								 rEntry.eOp == SC_ENDS_WITH && nPos != aCell.Len()-aQuer.Len()-1 )
+								bOk = FALSE;
 					}
-					if ( rEntry.eOp == SC_NOT_EQUAL )
+					if ( rEntry.eOp == SC_NOT_EQUAL || 
+						 rEntry.eOp == SC_DOES_NOT_CONTAIN )
 						bOk = !bOk;
 				}
 				else
