[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Thu Dec 30 01:34:00 UTC 2004
CVS commit by okellogg:
parse{Template,Attribute,Operation}: owningScope needs to be of type UMLClassifier.
M +10 -7 model_utils.cpp 1.15
M +5 -6 model_utils.h 1.12
--- kdesdk/umbrello/umbrello/model_utils.cpp #1.14:1.15
@@ -210,5 +210,5 @@ QString scopeToString(Uml::Scope scope,
}
-Parse_Status parseTemplate(QString t, NameAndType& nmTpPair, UMLPackage *owningScope) {
+Parse_Status parseTemplate(QString t, NameAndType& nmTpPair, UMLClassifier *owningScope) {
UMLDoc *pDoc = UMLApp::app()->getDocument();
@@ -220,8 +220,11 @@ Parse_Status parseTemplate(QString t, Na
QStringList nameAndType = QStringList::split( QRegExp("\\s*:\\s*"), t);
if (nameAndType.count() == 2) {
- UMLObject *pType = pDoc->findUMLObject(nameAndType[1], Uml::ot_UMLObject, owningScope);
+ UMLObject *pType = NULL;
+ if (nameAndType[1] != "class") {
+ 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);
} else {
nmTpPair = NameAndType(t, NULL);
@@ -230,5 +233,5 @@ Parse_Status parseTemplate(QString t, Na
}
-Parse_Status parseAttribute(QString a, NameAndType& nmTpPair, UMLPackage *owningScope) {
+Parse_Status parseAttribute(QString a, NameAndType& nmTpPair, UMLClassifier *owningScope) {
UMLDoc *pDoc = UMLApp::app()->getDocument();
@@ -248,5 +251,5 @@ Parse_Status parseAttribute(QString a, N
}
-Parse_Status parseOperation(QString m, OpDescriptor& desc, UMLPackage *owningScope) {
+Parse_Status parseOperation(QString m, OpDescriptor& desc, UMLClassifier *owningScope) {
UMLDoc *pDoc = UMLApp::app()->getDocument();
--- kdesdk/umbrello/umbrello/model_utils.h #1.11:1.12
@@ -31,5 +31,4 @@
// forward declarations
-class UMLPackage;
class UMLClassifier;
@@ -104,5 +103,5 @@ namespace Umbrello {
* Data structure filled by parseAttribute()
*/
- typedef QPair<QString, UMLClassifier*> NameAndType;
+ typedef QPair<QString, UMLObject*> NameAndType;
/**
@@ -118,5 +117,5 @@ namespace Umbrello {
QString m_name;
NameAndType_List m_args;
- UMLClassifier *m_pReturnType;
+ UMLObject *m_pReturnType;
};
@@ -131,5 +130,5 @@ namespace Umbrello {
* @return Error status of the parse, PS_OK for success.
*/
- Parse_Status parseTemplate(QString t, NameAndType& nmTpPair, UMLPackage *owningScope);
+ Parse_Status parseTemplate(QString t, NameAndType& nmTpPair, UMLClassifier *owningScope);
/**
@@ -142,5 +141,5 @@ namespace Umbrello {
* @return Error status of the parse, PS_OK for success.
*/
- Parse_Status parseAttribute(QString a, NameAndType& nmTpPair, UMLPackage *owningScope);
+ Parse_Status parseAttribute(QString a, NameAndType& nmTpPair, UMLClassifier *owningScope);
/**
@@ -154,5 +153,5 @@ namespace Umbrello {
* @return Error status of the parse, PS_OK for success.
*/
- Parse_Status parseOperation(QString m, OpDescriptor& desc, UMLPackage *owningScope);
+ Parse_Status parseOperation(QString m, OpDescriptor& desc, UMLClassifier *owningScope);
/**
More information about the umbrello-devel
mailing list