| 263 | |
| 264 | |
| 265 | void 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 | |
| 289 | void UndoManager::clearRedoSteps() |
nothing calls this directly
no test coverage detected