| 1468 | } |
| 1469 | |
| 1470 | void RoutingManager::CancelRoutePointsTransaction(uint32_t transactionId) |
| 1471 | { |
| 1472 | auto const it = m_routePointsTransactions.find(transactionId); |
| 1473 | if (it == m_routePointsTransactions.end()) |
| 1474 | return; |
| 1475 | auto routeMarks = it->second.m_routeMarks; |
| 1476 | |
| 1477 | // If we cancel a transaction we must remove all later transactions. |
| 1478 | for (auto it = m_routePointsTransactions.begin(); it != m_routePointsTransactions.end();) |
| 1479 | if (it->first >= transactionId) |
| 1480 | it = m_routePointsTransactions.erase(it); |
| 1481 | else |
| 1482 | ++it; |
| 1483 | |
| 1484 | // Revert route points. |
| 1485 | ASSERT(m_bmManager != nullptr, ()); |
| 1486 | auto editSession = m_bmManager->GetEditSession(); |
| 1487 | editSession.ClearGroup(UserMark::Type::ROUTING); |
| 1488 | RoutePointsLayout routePoints(*m_bmManager); |
| 1489 | for (auto & markData : routeMarks) |
| 1490 | routePoints.AddRoutePoint(std::move(markData)); |
| 1491 | } |
| 1492 | |
| 1493 | bool RoutingManager::HasSavedRoutePoints() const |
| 1494 | { |
no test coverage detected