Skip to content

Commit

Permalink
Removed references to distribution frames. Fix #15642
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Oct 28, 2024
1 parent c97bcde commit fe3f54c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/netedit/GNENetHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,7 @@ GNENetHelper::AttributeCarriers::insertDemandElement(GNEDemandElement* demandEle
void
GNENetHelper::AttributeCarriers::deleteDemandElement(GNEDemandElement* demandElement, const bool updateFrames) {
const auto tag = demandElement->getTagProperty().getTag();
auto viewParent = myNet->getViewNet()->getViewParent();
// find demanElement in demandElementTag
auto itFind = myDemandElements.at(tag).find(demandElement->getGUIGlObject());
// check if demandElement was previously inserted
Expand All @@ -2556,9 +2557,15 @@ GNENetHelper::AttributeCarriers::deleteDemandElement(GNEDemandElement* demandEle
}
// remove it from inspected elements and GNEElementTree
myNet->getViewNet()->removeFromAttributeCarrierInspected(demandElement);
myNet->getViewNet()->getViewParent()->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(demandElement);
myNet->getViewNet()->getViewParent()->getPersonPlanFrame()->getPersonHierarchy()->removeCurrentEditedAttributeCarrier(demandElement);
myNet->getViewNet()->getViewParent()->getContainerPlanFrame()->getContainerHierarchy()->removeCurrentEditedAttributeCarrier(demandElement);
viewParent->getInspectorFrame()->getHierarchicalElementTree()->removeCurrentEditedAttributeCarrier(demandElement);
viewParent->getPersonPlanFrame()->getPersonHierarchy()->removeCurrentEditedAttributeCarrier(demandElement);
viewParent->getContainerPlanFrame()->getContainerHierarchy()->removeCurrentEditedAttributeCarrier(demandElement);
if (viewParent->getRouteDistributionFrame()->getDistributionSelector()->getCurrentDistribution() == demandElement) {
viewParent->getRouteDistributionFrame()->getDistributionSelector()->setDistribution(nullptr);
}
if (viewParent->getTypeDistributionFrame()->getDistributionSelector()->getCurrentDistribution() == demandElement) {
viewParent->getTypeDistributionFrame()->getDistributionSelector()->setDistribution(nullptr);
}
// if is the last inserted route, remove it from GNEViewNet
if (myNet->getViewNet()->getLastCreatedRoute() == demandElement) {
myNet->getViewNet()->setLastCreatedRoute(nullptr);
Expand Down

0 comments on commit fe3f54c

Please sign in to comment.