Skip to content

Commit

Permalink
Merge branch 'branch-6-2'
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Aug 22, 2012
2 parents 67365bc + a148625 commit e632af4
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mapio.c
Expand Up @@ -197,7 +197,7 @@ void msIO_setHeader (const char *header, const char* value, ...)
#endif // MOD_WMS_ENABLED
msIO_fprintf(stdout,"%s: ",header);
msIO_vfprintf(stdout,value,args);
msIO_fprintf(stdout,"\n");
msIO_fprintf(stdout,"\r\n");
#ifdef MOD_WMS_ENABLED
}
#endif
Expand All @@ -209,7 +209,7 @@ void msIO_sendHeaders ()
msIOContext *ioctx = msIO_getHandler (stdout);
if(ioctx && !strcmp(ioctx->label,"apache")) return;
#endif // !MOD_WMS_ENABLED
msIO_printf ("\n");
msIO_printf ("\r\n");
fflush (stdout);
}

Expand Down
1 change: 1 addition & 0 deletions maplegend.c
Expand Up @@ -722,6 +722,7 @@ int msEmbedLegend(mapObj *map, imageObj *img)
if(!GET_LAYER(map, l)->class[0]->labels) {
if(msGrowClassLabels(GET_LAYER(map, l)->class[0]) == NULL) return MS_FAILURE;
initLabel(GET_LAYER(map, l)->class[0]->labels[0]);
GET_LAYER(map, l)->class[0]->numlabels = 1;
GET_LAYER(map, l)->class[0]->labels[0]->force = MS_TRUE;
GET_LAYER(map, l)->class[0]->labels[0]->size = MS_MEDIUM; /* must set a size to have a valid label definition */
GET_LAYER(map, l)->class[0]->labels[0]->priority = MS_MAX_LABEL_PRIORITY;
Expand Down
14 changes: 11 additions & 3 deletions mapmssql2008.c
Expand Up @@ -1656,10 +1656,18 @@ int msMSSQL2008LayerGetShapeRandom(layerObj *layer, shapeObj *shape, long *recor
if (rc == SQL_ERROR || rc == SQL_SUCCESS_WITH_INFO)
handleSQLError(layer);

oidBuffer[retLen] = 0;
record_oid = strtol(oidBuffer, NULL, 10);
if (retLen < sizeof(oidBuffer))
{
oidBuffer[retLen] = 0;
record_oid = strtol(oidBuffer, NULL, 10);
shape->index = record_oid;
}
else
{
/* non integer fid column, use single pass */
shape->index = -1;
}

shape->index = record_oid;
shape->resultindex = (*record);

(*record)++; /* move to next shape */
Expand Down
3 changes: 3 additions & 0 deletions mapogcsld.c
Expand Up @@ -2646,6 +2646,7 @@ int msSLDParseTextParams(CPLXMLNode *psRoot, layerObj *psLayer,
if(psClass->numlabels == 0) {
if(msGrowClassLabels(psClass) == NULL) return(MS_FAILURE);
initLabel(psClass->labels[0]);
psClass->numlabels++;
}
psLabelObj = psClass->labels[0];

Expand Down Expand Up @@ -2887,6 +2888,7 @@ int ParseTextPointPlacement(CPLXMLNode *psRoot, classObj *psClass)
if(psClass->numlabels == 0) {
if(msGrowClassLabels(psClass) == NULL) return(MS_FAILURE);
initLabel(psClass->labels[0]);
psClass->numlabels++;
}
psLabelObj = psClass->labels[0];

Expand Down Expand Up @@ -2991,6 +2993,7 @@ int ParseTextLinePlacement(CPLXMLNode *psRoot, classObj *psClass)
if(psClass->numlabels == 0) {
if(msGrowClassLabels(psClass) == NULL) return(MS_FAILURE);
initLabel(psClass->labels[0]);
psClass->numlabels++;
}
psLabelObj = psClass->labels[0];

Expand Down
1 change: 1 addition & 0 deletions mapscale.c
Expand Up @@ -432,6 +432,7 @@ int msEmbedScalebar(mapObj *map, imageObj *img)
if(!GET_LAYER(map, l)->class[0]->labels) {
if(msGrowClassLabels(GET_LAYER(map, l)->class[0]) == NULL) return MS_FAILURE;
initLabel(GET_LAYER(map, l)->class[0]->labels[0]);
GET_LAYER(map, l)->class[0]->numlabels = 1;
GET_LAYER(map, l)->class[0]->labels[0]->force = MS_TRUE;
GET_LAYER(map, l)->class[0]->labels[0]->size = MS_MEDIUM; /* must set a size to have a valid label definition */
GET_LAYER(map, l)->class[0]->labels[0]->priority = MS_MAX_LABEL_PRIORITY;
Expand Down
8 changes: 6 additions & 2 deletions mapshape.c
Expand Up @@ -2179,8 +2179,9 @@ int msTiledSHPNextShape(layerObj *layer, shapeObj *shape)
continue; /* skip NULL shapes */
}
shape->tileindex = tSHP->tileshpfile->lastshape;
shape->values = msDBFGetValueList(tSHP->shpfile->hDBF, i, layer->iteminfo, layer->numitems);
shape->numvalues = layer->numitems;
shape->values = msDBFGetValueList(tSHP->shpfile->hDBF, i, layer->iteminfo, layer->numitems);
if(!shape->values) shape->numvalues = 0;

filter_passed = MS_TRUE; /* By default accept ANY shape */
if(layer->numitems > 0 && layer->iteminfo) {
Expand Down Expand Up @@ -2553,8 +2554,11 @@ int msSHPLayerNextShape(layerObj *layer, shapeObj *shape)
msFreeShape(shape);
continue; /* skip NULL shapes */
}
shape->values = msDBFGetValueList(shpfile->hDBF, i, layer->iteminfo, layer->numitems);
shape->numvalues = layer->numitems;
shape->values = msDBFGetValueList(shpfile->hDBF, i, layer->iteminfo, layer->numitems);
if(!shape->values) {
shape->numvalues = 0;
}

filter_passed = MS_TRUE; /* By default accept ANY shape */
if(layer->numitems > 0 && layer->iteminfo) {
Expand Down
1 change: 1 addition & 0 deletions mapunion.c
Expand Up @@ -694,6 +694,7 @@ static int msUnionLayerGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, s
}
c->labels[i]->numbindings = 0;
}
c->numlabels = src->numlabels;

c->type = src->type;
c->layer = layer;
Expand Down
4 changes: 3 additions & 1 deletion mapxbase.c
Expand Up @@ -887,8 +887,10 @@ char **msDBFGetValueList(DBFHandle dbffile, int record, int *itemindexes, int nu

for(i=0; i<numitems; i++) {
value = msDBFReadStringAttribute(dbffile, record, itemindexes[i]);
if (value == NULL)
if (value == NULL) {
free(values);
return NULL; /* Error already reported by msDBFReadStringAttribute() */
}
values[i] = msStrdup(value);
}

Expand Down

0 comments on commit e632af4

Please sign in to comment.