[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Fri Aug 20 21:32:01 UTC 2004


CVS commit by okellogg: 

findObject(): Recurse into classifiers.


  M +22 -4     package.cpp   1.24


--- kdesdk/umbrello/umbrello/package.cpp  #1.23:1.24
@@ -84,8 +84,26 @@ UMLObject * UMLPackage::findObject(int i
                 if (obj->getID() == id)
                         return obj;
-                if (obj->getBaseType() == Uml::ot_Package) {
-                        UMLObject *o = ((UMLPackage*)obj)->findObject(id);
+                UMLObject *o;
+                UMLObject_Type t = obj->getBaseType();
+                switch (t) {
+                        case Uml::ot_Package:
+                                o = ((UMLPackage*)obj)->findObject(id);
+                                if (o)
+                                        return o;
+                                break;
+                        case Uml::ot_Interface:
+                        case Uml::ot_Class:
+                        case Uml::ot_Enum:
+                                o = ((UMLClassifier*)obj)->findChildObject(id);
                         if (o)
                                 return o;
+                                if (t == ot_Interface || t == ot_Class) {
+                                        o = ((UMLPackage*)obj)->findObject(id);
+                                        if (o)
+                                                return o;
+                                }
+                                break;
+                        default:
+                                break;
                 }
         }






More information about the umbrello-devel mailing list