[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Dec 30 04:45:05 UTC 2004


CVS commit by okellogg: 

parse{Attribute,Operation}: Consider template parameter names.


  M +15 -8     model_utils.cpp   1.16


--- kdesdk/umbrello/umbrello/model_utils.cpp  #1.15:1.16
@@ -26,4 +26,5 @@
 #include "package.h"
 #include "classifier.h"
+#include "template.h"
 #include "association.h"
 #include "umlrole.h"
@@ -244,8 +245,11 @@ Parse_Status parseAttribute(QString a, N
                 return PS_Malformed_Arg;
 
-        UMLObject *pType = pDoc->findUMLObject(nameAndType[1], Uml::ot_UMLObject, owningScope);
+        UMLObject *pType = owningScope->findTemplate(nameAndType[1]);
+        if (pType == NULL) {
+                pType = pDoc->findUMLObject(nameAndType[1], Uml::ot_UMLObject, owningScope);
         if (pType == NULL)
                 return PS_Unknown_ArgType;
-        nmTpPair = NameAndType(nameAndType[0], dynamic_cast<UMLClassifier*>(pType));
+        }
+        nmTpPair = NameAndType(nameAndType[0], pType);
         return PS_OK;
 }
@@ -268,8 +272,11 @@ Parse_Status parseOperation(QString m, O
                 QString retType = pat.cap(1);
                 if (retType != "void") {
-                        UMLObject *pRetType = pDoc->findUMLObject(retType, Uml::ot_UMLObject, owningScope);
+                        UMLObject *pRetType = owningScope->findTemplate(retType);
+                        if (pRetType == NULL) {
+                                pRetType = pDoc->findUMLObject(retType, Uml::ot_UMLObject, owningScope);
                         if (pRetType == NULL)
                                 return PS_Unknown_ReturnType;
-                        desc.m_pReturnType = dynamic_cast<UMLClassifier*>(pRetType);
+                        }
+                        desc.m_pReturnType = pRetType;
                 }
         }






More information about the umbrello-devel mailing list