[mapserver-commits] r13014 - branches/branch-6-0/mapserver

svn at osgeo.org svn at osgeo.org
Thu Jan 26 13:30:09 EST 2012


Author: aboudreault
Date: 2012-01-26 10:30:09 -0800 (Thu, 26 Jan 2012)
New Revision: 13014

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

Modified: branches/branch-6-0/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-6-0/mapserver/HISTORY.TXT	2012-01-26 16:16:31 UTC (rev 13013)
+++ branches/branch-6-0/mapserver/HISTORY.TXT	2012-01-26 18:30:09 UTC (rev 13014)
@@ -15,6 +15,8 @@
 Current Version (future 6.0.2, SVN branch-6-0):
 ---------------------------
 
+- Fixed SLD with FILTER doesn't apply properly to database layers (#4112)
+
 - Fixed a problem with calls to labelInImage() (maplabel.c) when label gutter
   and label buffers are both used (#3303). Also changed the usage around that
   function to make it easier to understand. At a result the

Modified: branches/branch-6-0/mapserver/mapogcsld.c
===================================================================
--- branches/branch-6-0/mapserver/mapogcsld.c	2012-01-26 16:16:31 UTC (rev 13013)
+++ branches/branch-6-0/mapserver/mapogcsld.c	2012-01-26 18:30:09 UTC (rev 13014)
@@ -419,14 +419,14 @@
                                                     msFree(pszSqlExpression);
                                                 }
                                                 else
-                                                {
+						{
                                                     bFailedExpression =1;
                                                     break;
                                                 }
                                                 FLTFreeFilterEncodingNode(psExpressionNode);
                                             }
                                             else
-                                            {
+					    {   
                                                 bFailedExpression =1;
                                                 break;
                                             }
@@ -436,9 +436,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);
                                     }
@@ -4710,31 +4707,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)
@@ -4746,24 +4726,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