[mapserver-commits] r11668 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue May 10 11:31:59 EDT 2011
Author: tamas
Date: 2011-05-10 08:31:59 -0700 (Tue, 10 May 2011)
New Revision: 11668
Modified:
trunk/mapserver/mapunion.c
Log:
Union layer: Fix for the item initialization at the source layer (#3859)
Modified: trunk/mapserver/mapunion.c
===================================================================
--- trunk/mapserver/mapunion.c 2011-05-10 14:39:41 UTC (rev 11667)
+++ trunk/mapserver/mapunion.c 2011-05-10 15:31:59 UTC (rev 11668)
@@ -235,6 +235,22 @@
}
}
+/* clean up expression tokens */
+int msUnionLayerFreeExpressionTokens(layerObj *layer)
+{
+ int i,j;
+ freeExpressionTokens(&(layer->filter));
+ freeExpressionTokens(&(layer->cluster.group));
+ freeExpressionTokens(&(layer->cluster.filter));
+ for(i=0; i<layer->numclasses; i++)
+ {
+ freeExpressionTokens(&(layer->class[i]->expression));
+ freeExpressionTokens(&(layer->class[i]->text));
+ for(j=0; j<layer->class[i]->numstyles; j++)
+ freeExpressionTokens(&(layer->class[i]->styles[j]->_geomtransform));
+ }
+}
+
/* allocate the iteminfo index array - same order as the item list */
int msUnionLayerInitItemInfo(layerObj *layer)
{
@@ -289,14 +305,7 @@
{
layerObj* srclayer = &layerinfo->layers[i];
- /* reopen the layer to clear all expressions*/
- msLayerClose(srclayer);
- layerinfo->status[i] = msLayerOpen(srclayer);
- if (layerinfo->status[i] != MS_SUCCESS)
- {
- msFree(itemlist);
- return MS_FAILURE;
- }
+ msUnionLayerFreeExpressionTokens(srclayer);
if (itemlist)
{
@@ -337,11 +346,7 @@
if (layer->styleitem && layer->numitems == 0)
{
/* need to initialize items */
- /* reopen the layer to clear all expressions*/
- msLayerClose(srclayer);
- layerinfo->status[i] = msLayerOpen(srclayer);
- if (layerinfo->status[i] != MS_SUCCESS)
- return MS_FAILURE;
+ msUnionLayerFreeExpressionTokens(srclayer);
/* get only the required items */
if (msLayerWhichItems(srclayer, FALSE, NULL) != MS_SUCCESS)
More information about the mapserver-commits
mailing list