MCPcopy Index your code
hub / github.com/MapServer/MapServer / msGrowLabelStyles

Function msGrowLabelStyles

mapfile.c:2919–2947  ·  view source on GitHub ↗

exactly the same as for a classObj */

Source from the content-addressed store, hash-verified

2917
2918/* exactly the same as for a classObj */
2919styleObj *msGrowLabelStyles( labelObj *label )
2920{
2921 /* Do we need to increase the size of styles[] by MS_STYLE_ALLOCSIZE?
2922 */
2923 if (label->numstyles == label->maxstyles) {
2924 styleObj **newStylePtr;
2925 int i, newsize;
2926
2927 newsize = label->maxstyles + MS_STYLE_ALLOCSIZE;
2928
2929 /* Alloc/realloc styles */
2930 newStylePtr = (styleObj**)realloc(label->styles,
2931 newsize*sizeof(styleObj*));
2932 MS_CHECK_ALLOC(newStylePtr, newsize*sizeof(styleObj*), NULL);
2933
2934 label->styles = newStylePtr;
2935 label->maxstyles = newsize;
2936 for(i=label->numstyles; i<label->maxstyles; i++) {
2937 label->styles[i] = NULL;
2938 }
2939 }
2940
2941 if (label->styles[label->numstyles]==NULL) {
2942 label->styles[label->numstyles]=(styleObj*)calloc(1,sizeof(styleObj));
2943 MS_CHECK_ALLOC(label->styles[label->numstyles], sizeof(styleObj), NULL);
2944 }
2945
2946 return label->styles[label->numstyles];
2947}
2948
2949/* msMaybeAllocateClassStyle()
2950**

Callers 4

msCopyLabelFunction · 0.85
loadLabelFunction · 0.85
msInsertLabelStyleFunction · 0.85
styleObj_label_newFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected