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

Method updateMapState

src/undo/undo_manager.cpp:265–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264
265void UndoManager::updateMapState(const UndoStep *step) const
266{
267 // Do nothing for a null map (which is the case for tests)
268 if (!map)
269 return;
270
271 // Make a modified part the current one
272 UndoStep::PartSet result_parts;
273 bool have_modified_objects = step->getModifiedParts(result_parts);
274 if (have_modified_objects && result_parts.find(map->getCurrentPartIndex()) == end(result_parts))
275 map->setCurrentPartIndex(*begin(result_parts));
276
277 // Select affected objects and ensure that they are visible
278 UndoStep::ObjectSet result_objects;
279 step->getModifiedObjects(map->getCurrentPartIndex(), result_objects);
280 map->clearObjectSelection(false);
281 for (auto object : result_objects)
282 map->addObjectToSelection(object, false);
283 emit map->objectSelectionChanged();
284
285 map->ensureVisibilityOfSelectedObjects(Map::PartialVisibility);
286}
287
288
289void UndoManager::clearRedoSteps()

Callers

nothing calls this directly

Calls 8

getCurrentPartIndexMethod · 0.80
setCurrentPartIndexMethod · 0.80
clearObjectSelectionMethod · 0.80
addObjectToSelectionMethod · 0.80
getModifiedPartsMethod · 0.45
findMethod · 0.45
getModifiedObjectsMethod · 0.45

Tested by

no test coverage detected