* Move the style down inside the array of styles. */
| 68 | * Move the style down inside the array of styles. |
| 69 | */ |
| 70 | int msMoveStyleDown(classObj *class, int nStyleIndex) |
| 71 | { |
| 72 | styleObj *psTmpStyle = NULL; |
| 73 | |
| 74 | if (class && nStyleIndex < class->numstyles-1 && nStyleIndex >=0) |
| 75 | { |
| 76 | psTmpStyle = (styleObj *)malloc(sizeof(styleObj)); |
| 77 | initStyle(psTmpStyle); |
| 78 | |
| 79 | msCopyStyle(psTmpStyle, class->styles[nStyleIndex]); |
| 80 | |
| 81 | msCopyStyle(class->styles[nStyleIndex], |
| 82 | class->styles[nStyleIndex+1]); |
| 83 | |
| 84 | msCopyStyle(class->styles[nStyleIndex+1], psTmpStyle); |
| 85 | |
| 86 | return(MS_SUCCESS); |
| 87 | } |
| 88 | msSetError(MS_CHILDERR, "Invalid index: %d", "msMoveStyleDown()", |
| 89 | nStyleIndex); |
| 90 | return (MS_FAILURE); |
| 91 | } |
| 92 | |
| 93 | /* Moved here from mapscript.i |
| 94 | * |
no test coverage detected