[QGIS Commit] r15102 - trunk/qgis/src/mapserver

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jan 28 18:52:58 EST 2011


Author: jef
Date: 2011-01-28 15:52:58 -0800 (Fri, 28 Jan 2011)
New Revision: 15102

Modified:
   trunk/qgis/src/mapserver/qgis_map_serv.cpp
   trunk/qgis/src/mapserver/qgswmsserver.cpp
Log:
mapserver: don't crash when WIDTH or HEIGHT are missing.

Modified: trunk/qgis/src/mapserver/qgis_map_serv.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgis_map_serv.cpp	2011-01-28 22:56:39 UTC (rev 15101)
+++ trunk/qgis/src/mapserver/qgis_map_serv.cpp	2011-01-28 23:52:58 UTC (rev 15102)
@@ -49,7 +49,7 @@
 #ifdef QGSMSDEBUG
   //print out some infos about the request
   QgsMSDebugMsg( "************************new request**********************" )
-  QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-mm-dd hh:mm:ss" ) );
+  QgsMSDebugMsg( QDateTime::currentDateTime().toString( "yyyy-MM-dd hh:mm:ss" ) );
 
   if ( getenv( "REMOTE_ADDR" ) != NULL )
   {

Modified: trunk/qgis/src/mapserver/qgswmsserver.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgswmsserver.cpp	2011-01-28 22:56:39 UTC (rev 15101)
+++ trunk/qgis/src/mapserver/qgswmsserver.cpp	2011-01-28 23:52:58 UTC (rev 15102)
@@ -715,10 +715,13 @@
     {
       width = 0; //width parameter is mandatory
     }
-    width = wit->second.toInt( &conversionSuccess );
-    if ( !conversionSuccess )
+    else
     {
-      width = 0;
+      width = wit->second.toInt( &conversionSuccess );
+      if ( !conversionSuccess )
+      {
+        width = 0;
+      }
     }
   }
 
@@ -729,10 +732,13 @@
     {
       height = 0; //height parameter is mandatory
     }
-    height = hit->second.toInt( &conversionSuccess );
-    if ( !conversionSuccess )
+    else
     {
-      height = 0;
+      height = hit->second.toInt( &conversionSuccess );
+      if ( !conversionSuccess )
+      {
+        height = 0;
+      }
     }
   }
 



More information about the QGIS-commit mailing list