[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Tue Apr 27 13:24:04 UTC 2004


CVS commit by okellogg: 

convert_LVT_OT(): Simplify usage.
isUnique(): Fix bug 79883 (problems with same name as another item.)


  M +11 -9     umllistview.cpp   1.93
  M +3 -4      umllistview.h   1.33


--- kdesdk/umbrello/umbrello/umllistview.cpp  #1.92:1.93
@@ -1276,7 +1276,6 @@ Uml::ListView_Type UMLListView::convert_
 }
 
-bool
-UMLListView::convert_LVT_OT(Uml::ListView_Type lvt, Uml::UMLObject_Type& ot) {
-        ot = (Uml::UMLObject_Type)0;
+Uml::UMLObject_Type UMLListView::convert_LVT_OT(Uml::ListView_Type lvt) {
+        Uml::UMLObject_Type ot = (Uml::UMLObject_Type)0;
         switch (lvt) {
         case Uml::lvt_UseCase:
@@ -1334,5 +1333,5 @@ UMLListView::convert_LVT_OT(Uml::ListVie
                 break;
         }
-        return ((int)ot != 0);
+        return ot;
 }
 
@@ -1744,6 +1743,6 @@ bool UMLListView::slotItemRenamed( QList
         case Uml::lvt_UseCase:
         {
-                Uml::UMLObject_Type ot;
-                if (! convert_LVT_OT(type, ot)) {
+                Uml::UMLObject_Type ot = convert_LVT_OT(type);
+                if (! ot) {
                         kdError() << "UMLListView::slotItemRenamed() internal" << endl;
                         return false;
@@ -2028,9 +2027,12 @@ bool UMLListView::isUnique( UMLListViewI
         case Uml::lvt_Actor:
         case Uml::lvt_UseCase:
-        case Uml::lvt_Class:
-        case Uml::lvt_Package:
-        case Uml::lvt_Component:
         case Uml::lvt_Node:
         case Uml::lvt_Artifact:
+        case Uml::lvt_Component:
+                return !m_doc->findUMLObject( name, convert_LVT_OT(type) );
+                break;
+
+        case Uml::lvt_Class:
+        case Uml::lvt_Package:
         case Uml::lvt_Interface:
         case Uml::lvt_Datatype:

--- kdesdk/umbrello/umbrello/umllistview.h  #1.32:1.33
@@ -345,9 +345,8 @@ class UMLListView : public KListView {
          *
          * @param lvt           The ListView_Type to convert.
-         * @param ot            The converted UMLObject_Type.
-         * @return      True if conversion was successful, i.e. the listview
-         *              type has a UMLObject_Type representation.
+         * @return      The converted UMLObject_Type if the listview type
+         *              has a UMLObject_Type representation, else 0.
          */
-        static bool convert_LVT_OT(Uml::ListView_Type lvt, Uml::UMLObject_Type& ot);
+        static Uml::UMLObject_Type convert_LVT_OT(Uml::ListView_Type lvt);
 
         /**






More information about the umbrello-devel mailing list