[Uml-devel] KDE/kdesdk/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Wed Jun 27 20:15:18 UTC 2007
SVN commit 681044 by okellogg:
merge r680416:680735 from branches/KDE/3.5
M +1 -0 ChangeLog
M +34 -17 umbrello/associationwidget.cpp
M +6 -6 umbrello/associationwidget.h
M +2 -4 umbrello/umlview.cpp
--- trunk/KDE/kdesdk/umbrello/ChangeLog #681043:681044
@@ -6,6 +6,7 @@
* Crash when linking to undefined xmi.id (146748)
* End Activity Symbol gets invalid when line thickness is increased (146925)
* The size of a fork/join is not restored (147069)
+* Crash when changing the association type to containment (147202)
Version 1.5.71
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #681043:681044
@@ -63,13 +63,13 @@
// the preferred constructor
AssociationWidget::AssociationWidget(UMLView *view, UMLWidget* pWidgetA,
Association_Type assocType, UMLWidget* pWidgetB,
- UMLAssociation *umlassoc /* = NULL */)
+ UMLObject *umlobject /* = NULL */)
: WidgetBase(view)
{
init(view);
- if (umlassoc)
- setUMLAssociation(umlassoc);
- else
+ if (umlobject) {
+ setUMLObject(umlobject);
+ } else {
// set up UMLAssociation obj if assoc is represented and both roles are UML objects
if (UMLAssociation::assocTypeHasUMLRepresentation(assocType)) {
UMLObject* umlRoleA = pWidgetA->getUMLObject();
@@ -100,6 +100,7 @@
setUMLAssociation(myAssoc);
}
}
+ }
setWidget(pWidgetA, A);
setWidget(pWidgetB, B);
@@ -2349,6 +2350,8 @@
else
menuType = ListPopupMenu::mt_Association_Selected;
}
+ if (m_pObject && getAssociation() == NULL) // atm m_pObject must be UMLAssociation
+ return; // @todo allow ListPopupMenu for other m_pObject types
m_pMenu = new ListPopupMenu(m_pView, menuType);
m_pMenu->popup(me -> globalPos());
connect(m_pMenu, SIGNAL(activated(int)), this, SLOT(slotMenuSelection(int)));
@@ -3210,19 +3213,33 @@
WidgetBase::setUMLObject(obj);
if (obj == NULL)
return;
- Uml::Object_Type ot = obj->getBaseType();
- if (ot == Uml::ot_Attribute) {
- UMLClassifier *klass = static_cast<UMLClassifier*>(obj->parent());
- connect(klass, SIGNAL(attributeRemoved(UMLClassifierListItem*)),
- this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
- } else if (ot == Uml::ot_EntityAttribute) {
- UMLEntity *ent = static_cast<UMLEntity*>(obj->parent());
- connect(ent, SIGNAL(entityAttributeRemoved(UMLClassifierListItem*)),
- this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
- } else if (ot == Uml::ot_ForeignKeyConstraint) {
- UMLEntity* ent = static_cast<UMLEntity*>(obj->parent());
- connect(ent, SIGNAL(entityConstraintRemoved(UMLClassifierListItem*)),
- this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
+ UMLClassifier *klass = NULL;
+ UMLEntity *ent = NULL;
+ const Uml::Object_Type ot = obj->getBaseType();
+ switch (ot) {
+ case Uml::ot_Association:
+ setUMLAssociation(dynamic_cast<UMLAssociation*>(obj));
+ break;
+ case Uml::ot_Operation:
+ setOperation(dynamic_cast<UMLOperation *>(obj));
+ break;
+ case Uml::ot_Attribute:
+ klass = static_cast<UMLClassifier*>(obj->parent());
+ connect(klass, SIGNAL(attributeRemoved(UMLClassifierListItem*)),
+ this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
+ break;
+ case Uml::ot_EntityAttribute:
+ ent = static_cast<UMLEntity*>(obj->parent());
+ connect(ent, SIGNAL(entityAttributeRemoved(UMLClassifierListItem*)),
+ this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
+ break;
+ case Uml::ot_ForeignKeyConstraint:
+ ent = static_cast<UMLEntity*>(obj->parent());
+ connect(ent, SIGNAL(entityConstraintRemoved(UMLClassifierListItem*)),
+ this, SLOT(slotClassifierListItemRemoved(UMLClassifierListItem*)));
+ default:
+ kError() << "UMLAssociation constructor: cannot associate UMLObject of type "
+ << ot << endl;
}
}
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h #681043:681044
@@ -76,15 +76,15 @@
/**
* Constructor.
*
- * @param view The parent view of this widget.
- * @param WidgetA Pointer the role A widget for the association.
- * @param Type The Association_Type for this association.
- * @param WidgetB Pointer the role B widget for the association.
- * @param umlassoc Pointer the underlying UMLAssociation (if applicable.)
+ * @param view The parent view of this widget.
+ * @param WidgetA Pointer to the role A widget for the association.
+ * @param Type The Association_Type for this association.
+ * @param WidgetB Pointer to the role B widget for the association.
+ * @param umlobject Pointer to the underlying UMLObject (if applicable.)
*/
AssociationWidget(UMLView *view, UMLWidget* WidgetA,
Uml::Association_Type Type, UMLWidget* WidgetB,
- UMLAssociation *umlassoc = NULL);
+ UMLObject *umlobject = NULL);
/**
* Deconstructor.
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #681043:681044
@@ -2308,8 +2308,7 @@
// stereotyped <<CORBAInterface>>, create a UniAssociation widget.
if (type->getStereotype() == "CORBAInterface")
assocType = at_UniAssociation;
- AssociationWidget *a = new AssociationWidget (this, widget, assocType, w);
- a->setUMLObject(attr);
+ AssociationWidget *a = new AssociationWidget (this, widget, assocType, w, attr);
a->calculateEndingPoints();
a->setVisibility(attr->getVisibility(), B);
/*
@@ -2339,8 +2338,7 @@
// create an aggregation AssocWidget from the ClassifierWidget
// to the widget of the referenced type
AssociationWidget *a = new AssociationWidget
- (this, widget, at_Aggregation, w);
- a->setUMLObject(attr);
+ (this, widget, at_Aggregation, w, attr);
a->calculateEndingPoints();
a->setVisibility(attr->getVisibility(), B);
//a->setChangeability(true, B);
More information about the umbrello-devel
mailing list