Skip to content

Commit

Permalink
Fix problems with STYLEITEM (#4534)
Browse files Browse the repository at this point in the history
  • Loading branch information
szekerest committed Dec 9, 2012
1 parent 6d2fe7d commit 82da39e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions maplayer.c
Expand Up @@ -702,11 +702,24 @@ int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c, shapeObj*
/* try to find out the current style format */
if (strncasecmp(stylestring,"style",5) == 0) {
resetClassStyle(c);
c->layer = layer;
if (msMaybeAllocateClassStyle(c, 0))
return(MS_FAILURE);

msUpdateStyleFromString(c->styles[0], stylestring, MS_FALSE);
if(c->styles[0]->symbolname) {
if((c->styles[0]->symbol = msGetSymbolIndex(&(map->symbolset), c->styles[0]->symbolname, MS_TRUE)) == -1) {
msSetError(MS_MISCERR, "Undefined symbol \"%s\" in class of layer %s.", "msLayerGetFeatureStyle()",
c->styles[0]->symbolname, layer->name);
return MS_FAILURE;
}
}
} else if (strncasecmp(stylestring,"class",5) == 0) {
if (strcasestr(stylestring, " style ") != NULL) {
/* reset style if stylestring contains style definitions */
resetClassStyle(c);
c->layer = layer;
}
msUpdateClassFromString(c, stylestring, MS_FALSE);
} else if (strncasecmp(stylestring,"pen",3) == 0 || strncasecmp(stylestring,"brush",5) == 0 ||
strncasecmp(stylestring,"symbol",6) == 0 || strncasecmp(stylestring,"label",5) == 0) {
Expand Down

0 comments on commit 82da39e

Please sign in to comment.