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

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Dec 26 18:06:50 PST 2016


Author: hubu
Date: 2016-12-26 18:06:50 -0800 (Mon, 26 Dec 2016)
New Revision: 9106

Modified:
   trunk/MgDev/Common/Stylization/StylizationEngine.cpp
Log:
#2754: Fail to stylize layer when expression in symbol definition has invalid value

Some settings of a symbol definition e.g. width/height can be expressions. Suppose a table has a column HEIGHT which type is double, and the height of symbol is 0.1*HEIGHT. Then if a feature's HEIGHT is null, a FDOException will be thrown when stylizing the feature, and stylize layer will fail.

To fix this bug, we catch FDOException when applying styles.

Modified: trunk/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2016-12-26 01:56:48 UTC (rev 9105)
+++ trunk/MgDev/Common/Stylization/StylizationEngine.cpp	2016-12-27 02:06:50 UTC (rev 9106)
@@ -1038,7 +1038,14 @@
 
             // evaluate the style (all expressions inside it) and convert to a
             // constant screen space render style
-            style->evaluate(&evalCtx);
+            try
+            {
+                style->evaluate(&evalCtx);
+            }
+            catch (FdoException* e)
+            {
+                ProcessStylizerException(e, __LINE__, __WFILE__);
+            }
 
             // compute offset to apply to the clipping bounds
             if (bClip)
@@ -1210,7 +1217,14 @@
                 else
                 {
                     // apply the style to the geometry using the renderer
-                    style->apply(&applyCtx);
+                    try
+                    {
+                        style->apply(&applyCtx);
+                    }
+                    catch (FdoException* e)
+                    {
+                        ProcessStylizerException(e, __LINE__, __WFILE__);
+                    }
                 }
             }
         }



More information about the mapguide-commits mailing list