[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Jan 1 15:53:14 UTC 2005
CVS commit by okellogg:
Comment by M. Alanen:
> Additionally, each subClass needs a
> <UML:GeneralizableElement.generalization>
> <UML:Generalization xmi.idref="e5" />
> </UML:GeneralizableElement.generalization>
> where "e5" here means the id of the Generalization.
CCBUG:56184
M +15 -0 classifier.cpp 1.65
--- kdesdk/umbrello/umbrello/classifier.cpp #1.64:1.65
@@ -432,4 +432,19 @@ void UMLClassifier::saveToXMI(QDomDocume
qElement.appendChild( tmplElement );
}
+ //save generalizations (we are the subclass, the other end is the superclass)
+ UMLAssociationList generalizations = getSpecificAssocs(Uml::at_Generalization);
+ if (generalizations.count()) {
+ QDomElement genElement = qDoc.createElement("UML:GeneralizableElement.generalization");
+ for (UMLAssociation *a = generalizations.first(); a; a = generalizations.next()) {
+ // We are the subclass if we are at the role A end.
+ if (m_nId != a->getObjectId(Uml::A))
+ continue;
+ QDomElement gElem = qDoc.createElement("UML:Generalization");
+ gElem.setAttribute( "xmi.idref", ID2STR(a->getID()) );
+ genElement.appendChild(gElem);
+ }
+ if (genElement.hasChildNodes())
+ qElement.appendChild( genElement );
+ }
}
More information about the umbrello-devel
mailing list