MCPcopy Create free account
hub / github.com/MapServer/MapServer / msDeleteLabelStyle

Function msDeleteLabelStyle

maplabel.c:1121–1139  ·  view source on GitHub ↗

* Delete the style identified by the index and shift * styles that follows the deleted style. */

Source from the content-addressed store, hash-verified

1119 * styles that follows the deleted style.
1120 */
1121int msDeleteLabelStyle(labelObj *label, int nStyleIndex)
1122{
1123 int i = 0;
1124 if (label && nStyleIndex < label->numstyles && nStyleIndex >=0)
1125 {
1126 if (freeStyle(label->styles[nStyleIndex]) == MS_SUCCESS)
1127 msFree(label->styles[nStyleIndex]);
1128 for (i=nStyleIndex; i< label->numstyles-1; i++)
1129 {
1130 label->styles[i] = label->styles[i+1];
1131 }
1132 label->styles[label->numstyles-1] = NULL;
1133 label->numstyles--;
1134 return(MS_SUCCESS);
1135 }
1136 msSetError(MS_CHILDERR, "Invalid index: %d", "msDeleteLabelStyle()",
1137 nStyleIndex);
1138 return (MS_FAILURE);
1139}
1140
1141styleObj *msRemoveLabelStyle(labelObj *label, int nStyleIndex) {
1142 int i;

Callers 1

labelObj_deleteStyleFunction · 0.85

Calls 3

freeStyleFunction · 0.85
msFreeFunction · 0.85
msSetErrorFunction · 0.85

Tested by

no test coverage detected