[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sun Feb 13 04:46:24 UTC 2005


CVS commit by okellogg: 

load(): Adjustment for loading return type in NSUML XMI.


  M +19 -1     operation.cpp   1.42


--- kdesdk/umbrello/umbrello/operation.cpp  #1.41:1.42
@@ -307,5 +307,23 @@ bool UMLOperation::load( QDomElement & e
                                 return false;
                 } else if (Uml::tagEq(tag, "Parameter")) {
-                        QString kind = attElement.attribute("kind", "in");
+                        QString kind = attElement.attribute("kind", "");
+                        if (kind.isEmpty()) {
+                                // Perhaps the kind is stored in a child node:
+                                for (QDomNode n = attElement.firstChild(); !n.isNull(); n = n.nextSibling()) {
+                                        if (n.isComment())
+                                                continue;
+                                        QDomElement tempElement = n.toElement();
+                                        QString tag = tempElement.tagName();
+                                        if (!Uml::tagEq(tag, "kind"))
+                                                continue;
+                                        kind = tempElement.attribute( "xmi.value", "" );
+                                        break;
+                                }
+                                if (kind.isEmpty()) {
+                                        kdDebug() << "UMLOperation::load(" << m_Name << "): "
+                                                  << "cannot find kind, using default \"in\"." << endl;
+                                        kind = "in";
+                                }
+                        }
                         if (kind == "return") {
                                 m_SecondaryId = attElement.attribute( "type", "" );






More information about the umbrello-devel mailing list