[Uml-devel] [Bug 56184] Umbrello XMI file format doesn't conform with uml13.dtd

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jan 1 15:54:07 UTC 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=56184        




------- Additional Comments From okellogg users sourceforge net  2005-01-02 00:52 -------
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