[mapserver-commits] r8489 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Tue Feb 3 15:35:25 EST 2009
Author: tomkralidis
Date: 2009-02-03 15:35:24 -0500 (Tue, 03 Feb 2009)
New Revision: 8489
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/shp2img.c
trunk/mapserver/shp2pdf.c
Log:
fix when layer status = DEFAULT and passing list of layers (#2066)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-02-03 15:04:16 UTC (rev 8488)
+++ trunk/mapserver/HISTORY.TXT 2009-02-03 20:35:24 UTC (rev 8489)
@@ -12,6 +12,8 @@
Current Version (5.3-dev, SVN trunk):
------------------------------------
+- fix when layer status = DEFAULT and passing list of layers (#2066)
+
- Fixed msAddLabel may cause access violation in certain conditions
- Changed base type of labelObj size, minsize and maxsize from int to double (#2766)
Modified: trunk/mapserver/shp2img.c
===================================================================
--- trunk/mapserver/shp2img.c 2009-02-03 15:04:16 UTC (rev 8488)
+++ trunk/mapserver/shp2img.c 2009-02-03 20:35:24 UTC (rev 8489)
@@ -253,30 +253,38 @@
if(strcmp(argv[i],"-l") == 0) { /* load layer list */
layers = msStringSplit(argv[i+1], ' ', &(num_layers));
- layer_found=0;
+ for(j=0; j<num_layers; j++) { /* loop over -l */
+ layer_found=0;
+ for(k=0; k<map->numlayers; k++) {
+ if(GET_LAYER(map, k)->name && strcmp(GET_LAYER(map, k)->name, layers[j]) == 0) {
+ layer_found=1;
+ break;
+ }
+ else {
+ invalid_layer = strdup(layers[j]);
+ }
+ }
+ if (layer_found==0) {
+ fprintf(stderr, "Layer (-l) %s not found\n", invalid_layer);
+ msCleanup();
+ exit(0);
+ }
+ }
+
for(j=0; j<map->numlayers; j++) {
if(GET_LAYER(map, j)->status == MS_DEFAULT)
- continue;
+ continue;
else {
GET_LAYER(map, j)->status = MS_OFF;
for(k=0; k<num_layers; k++) {
if(GET_LAYER(map, j)->name && strcmp(GET_LAYER(map, j)->name, layers[k]) == 0) {
GET_LAYER(map, j)->status = MS_ON;
- layer_found=1;
break;
}
- else {
- invalid_layer = strdup(layers[k]);
- }
}
}
}
- if (layer_found == 0) {
- fprintf(stderr, "Layer (-l) %s not found\n", invalid_layer);
- msCleanup();
- exit(0);
- }
msFreeCharArray(layers, num_layers);
Modified: trunk/mapserver/shp2pdf.c
===================================================================
--- trunk/mapserver/shp2pdf.c 2009-02-03 15:04:16 UTC (rev 8488)
+++ trunk/mapserver/shp2pdf.c 2009-02-03 20:35:24 UTC (rev 8489)
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id:$
+ * $Id$
*
* Project: MapServer
* Purpose: Commandline shape to pdf converter.
@@ -154,8 +154,25 @@
if(strncmp(argv[i],"-l",2) == 0) { /* load layer list */
layers = msStringSplit(argv[i+1], ' ', &(num_layers));
- layer_found=0;
+ for(j=0; j<num_layers; j++) { /* loop over -l */
+ layer_found=0;
+ for(k=0; k<map->numlayers; k++) {
+ if(GET_LAYER(map, k)->name && strcmp(GET_LAYER(map, k)->name, layers[j]) == 0) {
+ layer_found=1;
+ break;
+ }
+ else {
+ invalid_layer = strdup(layers[j]);
+ }
+ }
+ if (layer_found==0) {
+ fprintf(stderr, "Layer (-l) %s not found\n", invalid_layer);
+ msCleanup();
+ exit(0);
+ }
+ }
+
for(j=0; j<map->numlayers; j++) {
if(GET_LAYER(map, j)->status == MS_DEFAULT)
continue;
@@ -164,21 +181,11 @@
for(k=0; k<num_layers; k++) {
if(strcmp(GET_LAYER(map, j)->name, layers[k]) == 0) {
GET_LAYER(map, j)->status = MS_ON;
- layer_found=1;
break;
}
- else {
- invalid_layer = strdup(layers[k]);
- }
}
}
}
- if (layer_found == 0) {
- fprintf(stderr, "Layer (-l) %s not found\n", invalid_layer);
- msCleanup();
- exit(0);
- }
-
msFreeCharArray(layers, num_layers);
i+=1;
More information about the mapserver-commits
mailing list