[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jun 19 12:36:03 UTC 2004


CVS commit by okellogg: 

Fix bug 83346 (Can't have two classes in different packages named the same)


  M +9 -12     umllistview.cpp   1.103


--- kdesdk/umbrello/umbrello/umllistview.cpp  #1.102:1.103
@@ -2089,17 +2089,14 @@ bool UMLListView::isUnique( UMLListViewI
         case Uml::lvt_Enum:
         {
-                UMLObject *o = m_doc -> findUMLObject( name );
-                if (o == NULL)
-                        return true;
-                if (type == lvt_Package)  // This is perhaps a little coarse,
-                        return false;     // but overloading package names
-                                          // is bad style anyway, and forbidden
-                                          // in various programming languages.
-                UMLPackage *pkg = o->getUMLPackage();
                 if (parentItem->getType() != lvt_Package)
-                        return (pkg != NULL);
-                if (pkg == NULL)
-                        return false;
-                return (parentItem->getUMLObject() != pkg);
+                        return (m_doc->findUMLObject(name) == NULL);
+                UMLPackage *pkg = static_cast<UMLPackage*>(parentItem->getUMLObject());
+                if (pkg == NULL) {
+                        kdError() << "UMLListView::isUnique: internal error - "
+                                  << "parent listviewitem is package but has no UMLObject"
+                                  << endl;
+                        return true;
+                }
+                return (pkg->findObject(name) == NULL);
                 break;
         }






More information about the umbrello-devel mailing list