[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Feb 11 09:32:36 UTC 2005


CVS commit by okellogg: 

Adjustments for loading ArgoUML XMI.
Thanks to Anna Persson for providing the demo file.


  M +60 -60    umlobject.cpp   1.68
  M +1 -2      umlrole.cpp   1.38


--- kdesdk/umbrello/umbrello/umlobject.cpp  #1.67:1.68
@@ -342,5 +342,19 @@ bool UMLObject::resolveRef() {
         }
         UMLDoc *pDoc = UMLApp::app()->getDocument();
-        if (pDoc->isNativeXMIFile() && m_SecondaryId.contains(QRegExp("\\D"))) {
+        // In the new, XMI standard compliant save format,
+        // the type is the xmi.id of a UMLClassifier.
+        Uml::IDType id = STR2ID(m_SecondaryId);
+        m_pSecondary = pDoc->findObjectById(id);
+        if (m_pSecondary != NULL) {
+                m_SecondaryId = "";
+                maybeSignalObjectCreated();
+                return true;
+        }
+        if (!pDoc->isNativeXMIFile() || !m_SecondaryId.contains(QRegExp("\\D"))) {
+                kdError() << "UMLObject::resolveRef(" << m_Name
+                          << "): cannot find type with id "
+                          << ID2STR(id) << endl;
+                return false;
+        }
                 // Assume we're dealing with the older Umbrello format where
                 // the type name was saved in the "type" attribute rather
@@ -400,18 +414,4 @@ bool UMLObject::resolveRef() {
                 maybeSignalObjectCreated();
                 return true;
-        }
-        // New, XMI standard compliant save format:
-        // The type is the xmi.id of a UMLClassifier.
-        Uml::IDType id = STR2ID(m_SecondaryId);
-        m_pSecondary = pDoc->findObjectById(id);
-        if (m_pSecondary == NULL) {
-                kdError() << "UMLObject::resolveRef(" << m_Name
-                          << "): cannot find type with id "
-                          << ID2STR(id) << endl;
-                return false;
-        }
-        m_SecondaryId = "";
-        maybeSignalObjectCreated();
-        return true;
 }
 

--- kdesdk/umbrello/umbrello/umlrole.cpp  #1.37:1.38
@@ -273,6 +273,5 @@ bool UMLRole::load( QDomElement & elemen
                 } else if (m_SecondaryId.isEmpty() &&
                            (Uml::tagEq(tag, "type") ||
-                            Uml::tagEq(tag, "participant") ||
-                            Uml::tagEq(tag, "association"))) {
+                            Uml::tagEq(tag, "participant"))) {
                         m_SecondaryId = tempElement.attribute("xmi.id", "");
                         if (m_SecondaryId.isEmpty())






More information about the umbrello-devel mailing list