[mapguide-commits] r7255 - trunk/MgDev/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Dec 11 08:19:06 PST 2012


Author: waltweltonlair
Date: 2012-12-11 08:19:05 -0800 (Tue, 11 Dec 2012)
New Revision: 7255

Modified:
   trunk/MgDev/Common/Stylization/DefaultStylizer.cpp
Log:
Ticket 2200: Stylization: GetRulesFilter does not return match for default rule. Submitted on behalf of Anil Patel

Modified: trunk/MgDev/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/DefaultStylizer.cpp	2012-12-11 15:19:38 UTC (rev 7254)
+++ trunk/MgDev/Common/Stylization/DefaultStylizer.cpp	2012-12-11 16:19:05 UTC (rev 7255)
@@ -591,12 +591,16 @@
         RuleCollection* rulecoll = style->GetRules();
         int nRules = rulecoll->GetCount();
 
-        for (int j=0; j<nRules; ++j)
+        for (int j = nRules-1; j >= 0; --j)
         {
             CompositeRule* r = static_cast<CompositeRule*>(rulecoll->GetAt(j));
             const MdfString& temp = r->GetFilter(); 
 
-            if (!temp.empty())
+            // If any of the rules is the default rule, return an empty filter because the
+            // default rule will match all features, even those not matched by other rules.
+            if (temp.empty())
+                return NULL;
+            else
             {
                 if (filterstr.empty())
                     filterstr.append(L"("); // start filter



More information about the mapguide-commits mailing list