[mapserver-commits] r8893 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Apr 8 16:09:13 EDT 2009


Author: dmorissette
Date: 2009-04-08 16:09:12 -0400 (Wed, 08 Apr 2009)
New Revision: 8893

Modified:
   trunk/mapserver/maplabel.c
   trunk/mapserver/mapprimitive.c
Log:
Fixed handling of return value of msGetLabelSize() (#2974)

Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c	2009-04-08 19:40:55 UTC (rev 8892)
+++ trunk/mapserver/maplabel.c	2009-04-08 20:09:12 UTC (rev 8893)
@@ -777,7 +777,7 @@
     }
 
     if(msGetTruetypeTextBBox(img,font,size,string,rect,advances)!=MS_SUCCESS)
-        return MS_FAILURE;
+        return -1;
 
     /* bug 1449 fix (adjust baseline) */
     if(adjustBaseline) {
@@ -795,7 +795,7 @@
         free(firstLine);
       }
     }
-    return MS_SUCCESS;
+    return 0;
 #else
     msSetError(MS_TTFERR, "TrueType font support is not available.", "msGetLabelSize()");
     return(-1);

Modified: trunk/mapserver/mapprimitive.c
===================================================================
--- trunk/mapserver/mapprimitive.c	2009-04-08 19:40:55 UTC (rev 8892)
+++ trunk/mapserver/mapprimitive.c	2009-04-08 20:09:12 UTC (rev 8893)
@@ -1460,7 +1460,7 @@
     goto FAILURE;
   
   /* determine the total length of the text */
-  if (msGetLabelSize(img,string, label, &bbox, fontset, scalefactor, MS_FALSE, &offsets) == MS_FAILURE) {
+  if (msGetLabelSize(img,string, label, &bbox, fontset, scalefactor, MS_FALSE, &offsets) == -1) {
     *status = MS_FAILURE;
     goto FAILURE;
   }



More information about the mapserver-commits mailing list