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

Method deleteColor

src/core/map.cpp:1241–1273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241void Map::deleteColor(int pos)
1242{
1243 MapColor* color = color_set->colors[pos];
1244 if (color->getSpotColorMethod() == MapColor::SpotColor)
1245 {
1246 // Update dependent colors
1247 for (MapColor* map_color : color_set->colors)
1248 {
1249 if (map_color->removeSpotColorComponent(color))
1250 {
1251 updateSymbolIcons(map_color);
1252 emit colorChanged(map_color->getPriority(), map_color);
1253 }
1254 }
1255 }
1256
1257 color_set->erase(pos);
1258
1259 // Treat combined symbols first before their parts
1260 for (Symbol* symbol : symbols)
1261 {
1262 if (symbol->getType() == Symbol::Combined)
1263 symbol->colorDeletedEvent(color);
1264 }
1265 for (Symbol* symbol : symbols)
1266 {
1267 if (symbol->getType() != Symbol::Combined)
1268 symbol->colorDeletedEvent(color);
1269 }
1270 emit colorDeleted(pos, color);
1271
1272 delete color;
1273}
1274
1275int Map::findColorIndex(const MapColor* color) const
1276{

Callers 2

mergeISOMFunction · 0.45
applyMethod · 0.45

Calls 6

getSpotColorMethodMethod · 0.80
getPriorityMethod · 0.80
eraseMethod · 0.80
getTypeMethod · 0.45
colorDeletedEventMethod · 0.45

Tested by

no test coverage detected