diff --git a/OMEdit/OMEditLIB/Element/Element.cpp b/OMEdit/OMEditLIB/Element/Element.cpp index 91c967ebcc2..527b15c96f5 100644 --- a/OMEdit/OMEditLIB/Element/Element.cpp +++ b/OMEdit/OMEditLIB/Element/Element.cpp @@ -3345,8 +3345,7 @@ void Element::referenceElementDeleted() mpBusComponent = mpReferenceElement->getBusComponent(); } } else { - mpGraphicsView->removeItem(this); - mpGraphicsView->removeItem(mpOriginItem); + mpGraphicsView->removeElementItem(this); } if (mpGraphicsView->getViewType() == StringHandler::Icon) { mpGraphicsView->getModelWidget()->getLibraryTreeItem()->handleIconUpdated(); diff --git a/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp b/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp index 7d7cbc1d7bd..ec7fc215e5d 100644 --- a/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp +++ b/OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp @@ -2245,6 +2245,7 @@ void GraphicsView::removeInheritedClassElements() void GraphicsView::removeInheritedClassConnections() { foreach (LineAnnotation *pConnectionLineAnnotation, mInheritedConnectionsList) { + pConnectionLineAnnotation->clearCollidingConnections(); deleteInheritedConnectionFromList(pConnectionLineAnnotation); removeItem(pConnectionLineAnnotation); delete pConnectionLineAnnotation; @@ -2258,6 +2259,7 @@ void GraphicsView::removeInheritedClassConnections() void GraphicsView::removeInheritedClassTransitions() { foreach (LineAnnotation *pTransitionLineAnnotation, mInheritedTransitionsList) { + removeConnectionDetails(pTransitionLineAnnotation); deleteInheritedTransitionFromList(pTransitionLineAnnotation); removeItem(pTransitionLineAnnotation); delete pTransitionLineAnnotation; @@ -6724,10 +6726,10 @@ void ModelWidget::reDrawModelWidget(const ModelInfo &modelInfo) mpIconGraphicsView->removeInheritedClassTransitions(); mpIconGraphicsView->removeInheritedClassInitialStates(); mpDiagramGraphicsView->removeInheritedClassShapes(); - mpDiagramGraphicsView->removeInheritedClassElements(); mpDiagramGraphicsView->removeInheritedClassConnections(); mpDiagramGraphicsView->removeInheritedClassTransitions(); mpDiagramGraphicsView->removeInheritedClassInitialStates(); + mpDiagramGraphicsView->removeInheritedClassElements(); /* get model components, connection and shapes. */ // Draw icon view // reset the CoOrdinateSystem