Commit 2bb95adc authored by Oliver Kellogg's avatar Oliver Kellogg

umbrello/toolbarstateassociation.cpp partial reverting of commit 62ff3886

- In function setSecondWidget(), if validation by AssocRules is passed
  and both widgetA and widgetB are class widgets then do not create an
  attribute for case (type == Uml::AssociationType::Aggregation).
  Reason: Creating the attribute prevents creation of the aggregation to
  the role B type.  For more info see comments at the source location.

CCBUG: 420073
parent 57fef3b1
...@@ -245,7 +245,14 @@ void ToolBarStateAssociation::setSecondWidget() ...@@ -245,7 +245,14 @@ void ToolBarStateAssociation::setSecondWidget()
cleanAssociation(); cleanAssociation();
emit finished(); emit finished();
return; return;
} else if (type == Uml::AssociationType::Aggregation) { }
/* Activating this code will produce a DataType named as the Role B type
with a suffixed "*" to indicate it is a pointer type.
However, this is a non standard, C++ specific notation.
Further, if this code is activated then no Aggregation association to the
role B type will be shown. Instead, if the "B*" pointer type is dragged
to the diagram then a Composition to that type will be shown.
else if (type == Uml::AssociationType::Aggregation) {
UMLClassifier *c = widgetA->umlObject()->asUMLClassifier(); UMLClassifier *c = widgetA->umlObject()->asUMLClassifier();
UMLAttribute *attr = new UMLAttribute(c, c->uniqChildName(UMLObject::ot_Attribute)); UMLAttribute *attr = new UMLAttribute(c, c->uniqChildName(UMLObject::ot_Attribute));
attr->setTypeName(QString(QLatin1String("%1*")).arg(widgetB->umlObject()->name())); attr->setTypeName(QString(QLatin1String("%1*")).arg(widgetB->umlObject()->name()));
...@@ -253,7 +260,7 @@ void ToolBarStateAssociation::setSecondWidget() ...@@ -253,7 +260,7 @@ void ToolBarStateAssociation::setSecondWidget()
cleanAssociation(); cleanAssociation();
emit finished(); emit finished();
return; return;
} } */
} }
AssociationWidget *temp = AssociationWidget::create(m_pUMLScene, widgetA, type, widgetB); AssociationWidget *temp = AssociationWidget::create(m_pUMLScene, widgetA, type, widgetB);
FloatingTextWidget *wt = temp->textWidgetByRole(Uml::TextRole::Coll_Message); FloatingTextWidget *wt = temp->textWidgetByRole(Uml::TextRole::Coll_Message);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment