Bug 112531 - Cannot change type of existing attribute
Summary: Cannot change type of existing attribute
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-13 14:51 UTC by Emil Karlén
Modified: 2005-09-13 21:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Can't change properties of attributes of class 'A'. (21.64 KB, application/octet-stream)
2005-09-13 14:53 UTC, Emil Karlén
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Karlén 2005-09-13 14:51:38 UTC
Version:           1.4.89 (using KDE KDE 3.4.2)
Compiler:          gcc version 4.0.1 20050727 (Red Hat 4.0.1-5) 
OS:                Linux

using KDE v. 3.4.2-0.fc4.1.

1. Double-click on a class to open the Properties dialog.
2. Select "attributes".
3. Double-click an attribute.
4. click OK.
   I first tested it while changeing the type of the attribute, but
   I get the same response even if I don't.

Response:
 * in Swedish: "Attributnamnet du har valt används redan i den här operationen".
 * in free translation to english: "The attribute name you have chosen is already in use in this operation.".

: I can't change the attribute, and I get a complaint about a an operation.

5. If I change the name of the attribute the result is OK, but whenever I don't change anything or change anything else than the name, I get the error.
Comment 1 Emil Karlén 2005-09-13 14:53:41 UTC
Created attachment 12548 [details]
Can't change properties of attributes of class 'A'.
Comment 2 Oliver Kellogg 2005-09-13 21:28:33 UTC
SVN commit 460424 by okellogg:

apply(): Make sure the item returned by UMLClassifier::findChildObject()
 is not the dialog's own dedicated one.
BUG:112531


 M  +1 -1      umlattributedialog.cpp  
 M  +1 -1      umlentityattributedialog.cpp  
 M  +1 -1      umltemplatedialog.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/umlattributedialog.cpp #460423:460424
@@ -153,7 +153,7 @@
     }
     UMLClassifier * pConcept = dynamic_cast<UMLClassifier *>( m_pAttribute->parent() );
     UMLObject *o = pConcept->findChildObject(name);
-    if (o) {
+    if (o && o != m_pAttribute) {
         KMessageBox::error(this, i18n("The attribute name you have chosen is already being used in this operation."),
                            i18n("Attribute Name Not Unique"), false);
         m_pNameLE->setText( m_pAttribute->getName() );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/umlentityattributedialog.cpp #460423:460424
@@ -197,7 +197,7 @@
     }
     UMLClassifier * pConcept = dynamic_cast<UMLClassifier *>( m_pEntityAttribute->parent() );
     UMLObject *o = pConcept->findChildObject(name);
-    if (o) {
+    if (o && o != m_pEntityAttribute) {
         KMessageBox::error(this, i18n("The entity attribute name you have chosen is already being used in this operation."),
                            i18n("Entity Attribute Name Not Unique"), false);
         m_pNameLE->setText( m_pEntityAttribute->getName() );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/dialogs/umltemplatedialog.cpp #460423:460424
@@ -129,7 +129,7 @@
     UMLClassifier * pClass = dynamic_cast<UMLClassifier *>( m_pTemplate->parent() );
     if (pClass) {
         UMLObject *o = pClass->findChildObject(name);
-        if (o) {
+        if (o && o != m_pTemplate) {
             KMessageBox::error(this, i18n("The template parameter name you have chosen is already being used in this operation."),
                                i18n("Template Name Not Unique"), false);
             m_pNameLE->setText( m_pTemplate->getName() );