[mapserver-commits] r13085 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Feb 8 13:24:39 EST 2012


Author: aboudreault
Date: 2012-02-08 10:24:39 -0800 (Wed, 08 Feb 2012)
New Revision: 13085

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapogcsld.c
Log:
Fixed SLD with FILTER doesn't apply properly to database layers (#4112)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2012-02-08 00:48:52 UTC (rev 13084)
+++ trunk/mapserver/HISTORY.TXT	2012-02-08 18:24:39 UTC (rev 13085)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk, 6.1-dev, future 6.2): 
 -------------------------------------------------
 
+- Fixed SLD with FILTER doesn't apply properly to database layers (#4112)
+
 - Fixed lexer buffer size issue with single quotes in a string  (#4175)
 
 - WFS Quote Escape issue (#4087)

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2012-02-08 00:48:52 UTC (rev 13084)
+++ trunk/mapserver/mapogcsld.c	2012-02-08 18:24:39 UTC (rev 13085)
@@ -470,14 +470,14 @@
                                                     msFree(pszSqlExpression);
                                                 }
                                                 else
-                                                {
+						{
                                                     bFailedExpression =1;
                                                     break;
                                                 }
                                                 FLTFreeFilterEncodingNode(psExpressionNode);
                                             }
                                             else
-                                            {
+					    {   
                                                 bFailedExpression =1;
                                                 break;
                                             }
@@ -487,9 +487,6 @@
                                             snprintf(szTmp, sizeof(szTmp), "%s", "))");
                                             pszBuffer =msStringConcatenate(pszBuffer, szTmp);
                                             msLoadExpressionString(&lp->filter, pszBuffer);
-                                            for (k=0;k<lp->numclasses;k++)
-                                              freeExpression(&lp->class[k]->expression);
-                                              
                                         }
                                         msFree(pszBuffer);
                                     }
@@ -4824,31 +4821,14 @@
 /*      tests here are minimal to be able to parse simple expression    */
 /*      like A AND B, A OR B, NOT A.                                    */
 /* -------------------------------------------------------------------- */
-    pszAnd = strstr(pszExpression, " AND ");
-    if (!pszAnd)
-       pszAnd = strstr(pszExpression, " and ");
+    pszAnd = strcasestr(pszExpression, " AND ");
+    pszOr = strcasestr(pszExpression, " OR ");
+    pszNot = strcasestr(pszExpression, "NOT ");
 
-    pszOr = strstr(pszExpression, " OR ");
-    if (!pszOr)
-      pszOr = strstr(pszExpression, " or ");
-    
-
-    pszNot = strstr(pszExpression, "NOT ");
-    if (!pszNot)
-    {
-        pszNot = strstr(pszExpression, "not ");
-    }
-    
-
     if (!pszAnd && !pszOr)
     {
-        pszAnd = strstr(pszExpression, "AND(");
-        if (!pszAnd)
-          pszAnd = strstr(pszExpression, "and(");
-        
-        pszOr = strstr(pszExpression, "OR(");
-        if (!pszOr)
-          pszOr = strstr(pszExpression, "or(");
+        pszAnd = strcasestr(pszExpression, "AND(");
+        pszOr = strcasestr(pszExpression, "OR(");
     }
 
     if (!pszAnd && !pszOr && !pszNot)
@@ -4860,24 +4840,13 @@
 
     if (pszAnd)
     {
-        pszSecondAnd = strstr(pszAnd+3, " AND ");
-        if (!pszSecondAnd)
-           pszSecondAnd = strstr(pszAnd+3, " and ");
-
-        pszSecondOr = strstr(pszAnd+3, " OR ");
-        if (!pszSecondOr)
-          pszSecondOr = strstr(pszAnd+3, " or ");
+        pszSecondAnd = strcasestr(pszAnd+3, " AND ");
+        pszSecondOr = strcasestr(pszAnd+3, " OR ");
     }
     else if (pszOr)
     {
-        pszSecondAnd = strstr(pszOr+2, " AND ");
-        if (!pszSecondAnd)
-          pszSecondAnd = strstr(pszOr+2, " and ");
-
-        pszSecondOr = strstr(pszOr+2, " OR ");
-        if (!pszSecondOr)
-          pszSecondOr = strstr(pszOr+2, " or ");
-
+        pszSecondAnd = strcasestr(pszOr+2, " AND ");
+        pszSecondOr = strcasestr(pszOr+2, " OR ");
     }
 
     if (!pszSecondAnd && !pszSecondOr)



More information about the mapserver-commits mailing list