[mapserver-commits] r11522 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Mon Apr 11 09:15:00 EDT 2011
Author: assefa
Date: 2011-04-11 06:15:00 -0700 (Mon, 11 Apr 2011)
New Revision: 11522
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/maplabel.c
Log:
Check validity of renderer when using it to calculate label size (#3822)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-04-11 12:09:16 UTC (rev 11521)
+++ trunk/mapserver/HISTORY.TXT 2011-04-11 13:15:00 UTC (rev 11522)
@@ -15,6 +15,8 @@
Current Version (SVN trunk):
----------------------------
+- Check renderer before using it when calculating label size (#3822)
+
- allow palette file path to be relative to mapfile (#2115)
- use supplied offset for brushed lines (#3825, #3792)
Modified: trunk/mapserver/maplabel.c
===================================================================
--- trunk/mapserver/maplabel.c 2011-04-11 12:09:16 UTC (rev 11521)
+++ trunk/mapserver/maplabel.c 2011-04-11 13:15:00 UTC (rev 11522)
@@ -769,8 +769,14 @@
/* assumes an angle of 0 regardless of what's in the label object */
int msGetLabelSize(mapObj *map, labelObj *label, char *string, double size, rectObj *rect, double **advances)
{
+ rendererVTableObj *renderer = NULL;
+
+ if (map)
+ renderer =MS_MAP_RENDERER(map);
+
+ if (!renderer)
+ return MS_FAILURE;
if(label->type == MS_TRUETYPE) {
- rendererVTableObj *renderer = MS_MAP_RENDERER(map);
char *font=msFontsetLookupFont(&(map->fontset), label->font);
if(!font) {
//error message already set in fontset lookup
@@ -778,7 +784,6 @@
}
return msGetTruetypeTextBBox(renderer,font,size,string,rect,advances);
} else if(label->type == MS_BITMAP){
- rendererVTableObj *renderer = MS_MAP_RENDERER(map);
if(renderer->supports_bitmap_fonts)
return msGetRasterTextBBox(renderer,MS_NINT(label->size),string,rect);
else {
More information about the mapserver-commits
mailing list