MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / removeSymbolFromSelection

Method removeSymbolFromSelection

src/core/map.cpp:1021–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1019}
1020
1021bool 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
1045bool Map::isObjectSelected(const Object* object) const
1046{

Callers 3

createMobileGUIMethod · 0.80

Calls 5

eraseMethod · 0.80
endMethod · 0.45
beginMethod · 0.45
getSymbolMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected