[mapguide-commits] r7254 - sandbox/adsk/2.5k/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Dec 11 07:19:39 PST 2012


Author: gregboone
Date: 2012-12-11 07:19:38 -0800 (Tue, 11 Dec 2012)
New Revision: 7254

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

Modified: sandbox/adsk/2.5k/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- sandbox/adsk/2.5k/Common/Stylization/DefaultStylizer.cpp	2012-12-11 09:00:32 UTC (rev 7253)
+++ sandbox/adsk/2.5k/Common/Stylization/DefaultStylizer.cpp	2012-12-11 15:19:38 UTC (rev 7254)
@@ -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