| 302 | |
| 303 | template<class FeatureType> |
| 304 | void VisualTool<FeatureType>::RemoveSelection(FeatureType *feat) { |
| 305 | if (!sel_features.erase(feat) || !feat->line) return; |
| 306 | for (auto sel : sel_features) |
| 307 | if (sel->line == feat->line) return; |
| 308 | |
| 309 | auto sel = c->selectionController->GetSelectedSet(); |
| 310 | |
| 311 | // Don't deselect the only selected line |
| 312 | if (sel.size() <= 1) return; |
| 313 | |
| 314 | sel.erase(feat->line); |
| 315 | |
| 316 | // Set the active line to an arbitrary selected line if we just |
| 317 | // deselected the active line |
| 318 | AssDialogue *new_active = c->selectionController->GetActiveLine(); |
| 319 | if (feat->line == new_active) |
| 320 | new_active = *sel.begin(); |
| 321 | |
| 322 | c->selectionController->SetSelectionAndActive(std::move(sel), new_active); |
| 323 | } |
| 324 | |
| 325 | //////// PARSERS |
| 326 |
nothing calls this directly
no test coverage detected