* Move the style up inside the array of styles. */
| 1066 | * Move the style up inside the array of styles. |
| 1067 | */ |
| 1068 | int msMoveLabelStyleUp(labelObj *label, int nStyleIndex) |
| 1069 | { |
| 1070 | styleObj *psTmpStyle = NULL; |
| 1071 | if (label && nStyleIndex < label->numstyles && nStyleIndex >0) |
| 1072 | { |
| 1073 | psTmpStyle = (styleObj *)malloc(sizeof(styleObj)); |
| 1074 | initStyle(psTmpStyle); |
| 1075 | |
| 1076 | msCopyStyle(psTmpStyle, label->styles[nStyleIndex]); |
| 1077 | |
| 1078 | msCopyStyle(label->styles[nStyleIndex], |
| 1079 | label->styles[nStyleIndex-1]); |
| 1080 | |
| 1081 | msCopyStyle(label->styles[nStyleIndex-1], psTmpStyle); |
| 1082 | |
| 1083 | return(MS_SUCCESS); |
| 1084 | } |
| 1085 | msSetError(MS_CHILDERR, "Invalid index: %d", "msMoveLabelStyleUp()", |
| 1086 | nStyleIndex); |
| 1087 | return (MS_FAILURE); |
| 1088 | } |
| 1089 | |
| 1090 | |
| 1091 | /** |
no test coverage detected