@@ -2694,23 +2694,6 @@ GNENetHelper::AttributeCarriers::deleteDemandElement(GNEDemandElement* demandEle
26942694 // remove it from inspected elements and GNEElementTree
26952695 myNet->getViewNet ()->getInspectedElements ().uninspectAC (demandElement);
26962696 demandElement->unmarkForDrawingFront ();
2697- viewParent->getInspectorFrame ()->getHierarchicalElementTree ()->removeCurrentEditedAttributeCarrier (demandElement);
2698- viewParent->getPersonPlanFrame ()->getPersonHierarchy ()->removeCurrentEditedAttributeCarrier (demandElement);
2699- viewParent->getContainerPlanFrame ()->getContainerHierarchy ()->removeCurrentEditedAttributeCarrier (demandElement);
2700- // update distribution frames
2701- if (viewParent->getRouteDistributionFrame ()->getDistributionSelector ()->getCurrentDistribution () == demandElement) {
2702- viewParent->getRouteDistributionFrame ()->getDistributionSelector ()->setDistribution (nullptr );
2703- }
2704- if (viewParent->getTypeDistributionFrame ()->getDistributionSelector ()->getCurrentDistribution () == demandElement) {
2705- viewParent->getTypeDistributionFrame ()->getDistributionSelector ()->setDistribution (nullptr );
2706- }
2707- // special case for distribution references
2708- if (demandElement->getTagProperty ()->getTag () == GNE_TAG_VTYPEREF) {
2709- viewParent->getTypeDistributionFrame ()->getDistributionValuesEditor ()->refreshRows ();
2710- }
2711- if (demandElement->getTagProperty ()->getTag () == GNE_TAG_ROUTEREF) {
2712- viewParent->getRouteDistributionFrame ()->getDistributionValuesEditor ()->refreshRows ();
2713- }
27142697 // if is the last inserted route, remove it from GNEViewNet
27152698 if (myNet->getViewNet ()->getLastCreatedRoute () == demandElement) {
27162699 myNet->getViewNet ()->setLastCreatedRoute (nullptr );
@@ -2720,6 +2703,23 @@ GNENetHelper::AttributeCarriers::deleteDemandElement(GNEDemandElement* demandEle
27202703 // check if update demand elements frames
27212704 if (updateFrames) {
27222705 updateDemandElementFrames (demandElement->getTagProperty ());
2706+ viewParent->getInspectorFrame ()->getHierarchicalElementTree ()->removeCurrentEditedAttributeCarrier (demandElement);
2707+ viewParent->getPersonPlanFrame ()->getPersonHierarchy ()->removeCurrentEditedAttributeCarrier (demandElement);
2708+ viewParent->getContainerPlanFrame ()->getContainerHierarchy ()->removeCurrentEditedAttributeCarrier (demandElement);
2709+ // update distribution frames
2710+ if (viewParent->getRouteDistributionFrame ()->getDistributionSelector ()->getCurrentDistribution () == demandElement) {
2711+ viewParent->getRouteDistributionFrame ()->getDistributionSelector ()->setDistribution (nullptr );
2712+ }
2713+ if (viewParent->getTypeDistributionFrame ()->getDistributionSelector ()->getCurrentDistribution () == demandElement) {
2714+ viewParent->getTypeDistributionFrame ()->getDistributionSelector ()->setDistribution (nullptr );
2715+ }
2716+ // special case for distribution references
2717+ if (demandElement->getTagProperty ()->getTag () == GNE_TAG_VTYPEREF) {
2718+ viewParent->getTypeDistributionFrame ()->getDistributionValuesEditor ()->refreshRows ();
2719+ }
2720+ if (demandElement->getTagProperty ()->getTag () == GNE_TAG_ROUTEREF) {
2721+ viewParent->getRouteDistributionFrame ()->getDistributionValuesEditor ()->refreshRows ();
2722+ }
27232723 }
27242724 // demandElements has to be saved
27252725 myNet->getSavingStatus ()->requireSaveDemandElements ();
0 commit comments