Skip to content

Commit

Permalink
Mark the model modified when component is removed. Properly check if …
Browse files Browse the repository at this point in the history
…Icon view has annotation or not.
  • Loading branch information
adeas31 committed Oct 13, 2015
1 parent a777e79 commit f0d262f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp
Expand Up @@ -575,6 +575,8 @@ void GraphicsView::deleteComponentObject(Component *pComponent)
TLMEditor *pTLMEditor = dynamic_cast<TLMEditor*>(mpModelWidget->getEditor());
pTLMEditor->deleteSubModel(pComponent->getName());
}
// make the model modified
mpModelWidget->setModelModified();
}

/*!
Expand Down Expand Up @@ -1074,10 +1076,18 @@ QPointF GraphicsView::roundPoint(QPointF point)
bool GraphicsView::hasAnnotation()
{
foreach (ModelWidget::InheritedClass *pInheritedClass, mpModelWidget->getInheritedClassesList()) {
if (mViewType == StringHandler::Icon && pInheritedClass->mIconShapesList.size() > 0) {
return true;
if (mViewType == StringHandler::Icon) {
if (pInheritedClass->mIconShapesList.size() > 0) {
return true;
} else {
foreach (Component *pInheritedComponent, pInheritedClass->mIconComponentsList) {
if (pInheritedComponent->hasShapeAnnotation(pInheritedComponent)) {
return true;
}
}
}
} else if (mViewType == StringHandler::Diagram && pInheritedClass->mDiagramShapesList.size() > 0) {

return true;
}
}
if (!mShapesList.isEmpty()) {
Expand Down

0 comments on commit f0d262f

Please sign in to comment.