Skip to content

Commit

Permalink
Remove inherited connections before deleting inherited elements (#11339)
Browse files Browse the repository at this point in the history
Fixes #11333
  • Loading branch information
adeas31 committed Oct 5, 2023
1 parent 4b69a3e commit 28a7ca9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions OMEdit/OMEditLIB/Element/Element.cpp
Expand Up @@ -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();
Expand Down
4 changes: 3 additions & 1 deletion OMEdit/OMEditLIB/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -2245,6 +2245,7 @@ void GraphicsView::removeInheritedClassElements()
void GraphicsView::removeInheritedClassConnections()
{
foreach (LineAnnotation *pConnectionLineAnnotation, mInheritedConnectionsList) {
pConnectionLineAnnotation->clearCollidingConnections();
deleteInheritedConnectionFromList(pConnectionLineAnnotation);
removeItem(pConnectionLineAnnotation);
delete pConnectionLineAnnotation;
Expand All @@ -2258,6 +2259,7 @@ void GraphicsView::removeInheritedClassConnections()
void GraphicsView::removeInheritedClassTransitions()
{
foreach (LineAnnotation *pTransitionLineAnnotation, mInheritedTransitionsList) {
removeConnectionDetails(pTransitionLineAnnotation);
deleteInheritedTransitionFromList(pTransitionLineAnnotation);
removeItem(pTransitionLineAnnotation);
delete pTransitionLineAnnotation;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 28a7ca9

Please sign in to comment.