[Uml-devel] KDE_3_2_BRANCH: kdesdk/umbrello/umbrello
Jonathan Riddell
jri at jriddell.org
Tue Feb 10 11:17:04 UTC 2004
CVS commit by jriddell:
Backport beastie fix of Feb 7th
--
CVS commit by okellogg:
createOperation: Fix.
M +11 -18 umldoc.cpp 1.122.2.3
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.122.2.2:1.122.2.3
@@ -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