* @brief Compute the new ordinal for an item after a list move; mirrors std::vector reorder. */
| 3487 | * @brief Compute the new ordinal for an item after a list move; mirrors std::vector reorder. |
| 3488 | */ |
| 3489 | static int projectedAfterMove(int oldIndex, int from, int to) |
| 3490 | { |
| 3491 | if (oldIndex == from) |
| 3492 | return to; |
| 3493 | |
| 3494 | if (from < to && oldIndex > from && oldIndex <= to) |
| 3495 | return oldIndex - 1; |
| 3496 | |
| 3497 | if (from > to && oldIndex >= to && oldIndex < from) |
| 3498 | return oldIndex + 1; |
| 3499 | |
| 3500 | return oldIndex; |
| 3501 | } |
| 3502 | |
| 3503 | /** |
| 3504 | * @brief Moves a dataset to a new position within its group. |
no outgoing calls
no test coverage detected