[mapserver-commits] r11094 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Mar 6 14:38:24 EST 2011
Author: rouault
Date: 2011-03-06 11:38:24 -0800 (Sun, 06 Mar 2011)
New Revision: 11094
Modified:
trunk/mapserver/mapkmlrenderer.cpp
trunk/mapserver/mapkmlrenderer.h
Log:
KML renderer: fix compiler warning, and memory leak
Modified: trunk/mapserver/mapkmlrenderer.cpp
===================================================================
--- trunk/mapserver/mapkmlrenderer.cpp 2011-03-06 19:16:02 UTC (rev 11093)
+++ trunk/mapserver/mapkmlrenderer.cpp 2011-03-06 19:38:24 UTC (rev 11094)
@@ -42,10 +42,10 @@
KmlRenderer::KmlRenderer(int width, int height, outputFormatObj *format, colorObj* color/*=NULL*/)
- : XmlDoc(NULL), LayerNode(NULL), GroundOverlayNode(NULL), Width(width), Height(height),
- FirstLayer(MS_TRUE), MapCellsize(1.0),
- PlacemarkNode(NULL), GeomNode(NULL),
- Items(NULL), NumItems(0), map(NULL), currentLayer(NULL), mElevationFromAttribute( false ), mElevationAttributeIndex( -1 ), mCurrentElevationValue(0.0)
+ : Width(width), Height(height), MapCellsize(1.0), XmlDoc(NULL), LayerNode(NULL), GroundOverlayNode(NULL),
+ PlacemarkNode(NULL), GeomNode(NULL),
+ Items(NULL), NumItems(0), FirstLayer(MS_TRUE), map(NULL), currentLayer(NULL),
+ mElevationFromAttribute( false ), mElevationAttributeIndex( -1 ), mCurrentElevationValue(0.0)
{
/*private variables*/
@@ -103,6 +103,9 @@
if (StyleHashTable)
msFreeHashTable(StyleHashTable);
+ if(LineStyle)
+ msFree(LineStyle);
+
xmlCleanupParser();
}
@@ -524,7 +527,7 @@
/*always add a name. It will be replaced by a text value if available*/
char tmpid[100];
char *stmp=NULL, *layerName=NULL;
- sprintf(tmpid, ".%d_%d", CurrentShapeIndex);
+ sprintf(tmpid, ".%d", CurrentShapeIndex);
layerName = getLayerName(currentLayer);
stmp = msStringConcatenate(stmp, layerName);
stmp = msStringConcatenate(stmp, tmpid);
@@ -802,7 +805,7 @@
xmlNewChild(groundOverlayNode, NULL, BAD_CAST "name", BAD_CAST layerName);
if (layer->opacity > 0 && layer->opacity < 100)
{
- sprintf(layerHexColor, "%02xffffff", MS_NINT(layer->opacity*2.55));
+ sprintf(layerHexColor, "%02xffffff", (unsigned int)MS_NINT(layer->opacity*2.55));
xmlNewChild(groundOverlayNode, NULL, BAD_CAST "color", BAD_CAST layerHexColor);
}
else
@@ -877,7 +880,7 @@
CurrentShapeIndex = -1;
}
-xmlNodePtr KmlRenderer::getGeomParentNode(char *geomName)
+xmlNodePtr KmlRenderer::getGeomParentNode(const char *geomName)
{
/*we do not need a multi-geometry for point layers*/
Modified: trunk/mapserver/mapkmlrenderer.h
===================================================================
--- trunk/mapserver/mapkmlrenderer.h 2011-03-06 19:16:02 UTC (rev 11093)
+++ trunk/mapserver/mapkmlrenderer.h 2011-03-06 19:38:24 UTC (rev 11094)
@@ -132,7 +132,7 @@
char* lookupPlacemarkStyle();
void flushPlacemark();
- xmlNodePtr getGeomParentNode(char *geomName);
+ xmlNodePtr getGeomParentNode(const char *geomName);
char* getLayerName(layerObj *layer);
void processLayer(layerObj *layer);
void addLineStyleToList(strokeStyleObj *style);
More information about the mapserver-commits
mailing list