Bug 100290 - Only the first attribute of the many with the same type is displayed in the class diagram
Summary: Only the first attribute of the many with the same type is displayed in the c...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.3.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-26 02:49 UTC by David
Modified: 2005-02-26 12:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David 2005-02-26 02:49:50 UTC
Version:           1.3.2 (using KDE 3.3.2, compiled sources)
Compiler:          gcc version 3.4.3
OS:                Linux (i686) release 2.6.8-24-default

If you import C++ classes with the following definition

class FirstClass {
}


class SecondCLass {
  FirstClass a;
  FirstClass b;
  FirstCLass c;
}

You see only in the class diagram the composition with the "a" attribute for SecondClass. The view code show all 3 attributes.
Comment 1 Oliver Kellogg 2005-02-26 12:25:55 UTC
CVS commit by okellogg: 

createAutoAttributeAssociations(): Consider attribute name (corresponds
 to association role B name) when deciding whether a given association widget
 between two given classes already exists.
BUG:100290 


  M +3 -1      umlview.cpp   1.208


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.207:1.208
@@ -2499,8 +2499,10 @@ void UMLView::createAutoAttributeAssocia
                 Uml::Association_Type assocType = Uml::at_Composition;
                 UMLWidget *w = findWidget( attrType->getID() );
+                AssociationWidget *aw = NULL;
                 // if the attribute type has a widget representation on this view
                 if (w &&
                     // if the AssocWidget does not already exist then
-                    findAssocWidget(assocType, widget, w) == NULL &&
+                    ((aw = findAssocWidget(assocType, widget, w)) == NULL ||
+                      aw->getRoleName(Uml::B) != attr->getName()) &&
                     // if the current diagram type permits compositions
                     AssocRules::allowAssociation(assocType, widget, w, false)) {