| 1019 | } |
| 1020 | |
| 1021 | bool Map::removeSymbolFromSelection(const Symbol* symbol, bool emit_selection_changed) |
| 1022 | { |
| 1023 | bool removed_at_least_one_object = false; |
| 1024 | auto it_end = object_selection.end(); |
| 1025 | for (auto it = object_selection.begin(); it != it_end; ) |
| 1026 | { |
| 1027 | if ((*it)->getSymbol() != symbol) |
| 1028 | { |
| 1029 | ++it; |
| 1030 | continue; |
| 1031 | } |
| 1032 | |
| 1033 | removed_at_least_one_object = true; |
| 1034 | removeSelectionRenderables(*it); |
| 1035 | Object* removed_object = *it; |
| 1036 | it = object_selection.erase(it); |
| 1037 | if (first_selected_object == removed_object) |
| 1038 | first_selected_object = object_selection.empty() ? nullptr : *object_selection.begin(); |
| 1039 | } |
| 1040 | if (emit_selection_changed && removed_at_least_one_object) |
| 1041 | emit objectSelectionChanged(); |
| 1042 | return removed_at_least_one_object; |
| 1043 | } |
| 1044 | |
| 1045 | bool Map::isObjectSelected(const Object* object) const |
| 1046 | { |
no test coverage detected