[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Feb 7 14:19:24 UTC 2004


CVS commit by okellogg: 

createOperation: Fix.


  M +11 -18    umldoc.cpp   1.126


--- kdesdk/umbrello/umbrello/umldoc.cpp  #1.125:1.126
@@ -873,26 +873,12 @@ UMLOperation* UMLDoc::createOperation(UM
                 return NULL;
         }
-        UMLOperation *op = NULL;
-        if (name == QString::null || name.isEmpty()) {
-                op = new UMLOperation( NULL, "", getUniqueID());
-                op->setName( classifier->uniqChildName(Uml::ot_Operation) );
-                //hack, make op a child of classifier without really adding it as operation
-                //this makes the Op.Dialog smoother in case of name conflicts
-                // classifier->insertChild( op );
-                do {
-                        UMLOperationDialog operationDialogue(0, op);
-                        if( operationDialogue.exec() != QDialog::Accepted ) {
-                                delete op;
-                                return NULL;
-                        }
-                } while (classifier->checkOperationSignature(op->getName(), params));
-        } else {
+        if (name != QString::null && !name.isEmpty()) {
                 UMLOperation *existingOp = classifier->checkOperationSignature(name, params);
                 if (existingOp)
                         return existingOp;
-                op = new UMLOperation( 0L, name, getUniqueID());
         }
-
-        if(params)
+        UMLOperation *op = new UMLOperation(NULL, name, getUniqueID());
+        op->setName( classifier->uniqChildName(Uml::ot_Operation) );
+        if (params)
         {
                 UMLAttributeListIt it(*params);
@@ -904,4 +890,11 @@ UMLOperation* UMLDoc::createOperation(UM
                 }
         }
+        do {
+                UMLOperationDialog operationDialogue(0, op);
+                if( operationDialogue.exec() != QDialog::Accepted ) {
+                        delete op;
+                        return NULL;
+                }
+        } while (classifier->checkOperationSignature(op->getName(), op->getParmList()));
 
         // operation name is ok, formally add it to the classifier






More information about the umbrello-devel mailing list