* Delete the style identified by the index and shift * styles that follows the deleted style. */
| 1119 | * styles that follows the deleted style. |
| 1120 | */ |
| 1121 | int 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 | |
| 1141 | styleObj *msRemoveLabelStyle(labelObj *label, int nStyleIndex) { |
| 1142 | int i; |
no test coverage detected