Bug 106632 - relationships between interfaces and classes change over file reload
Summary: relationships between interfaces and classes change over file reload
Status: CLOSED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Oliver Kellogg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-01 22:14 UTC by Søren Holm
Modified: 2009-09-02 22:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Søren Holm 2005-06-01 22:16:03 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          GCC 3.4.3 CFLAGS=-march=pentium4 -O3 -pipe -fomit-frame-pointer    CXXFLAGS=-march=pentium4 -O3 -pipe -fomit-frame-pointer -fvisibility-inlines-hidden
OS:                Linux

I have two interfaces and two classes - Interface1 and Interface2, Class1 and Class2. Class1 inherits Interface1, Class2 inherits Interface2. Now I want Class1 to have and association to Inteface2 and Class2 to have and association to Interface1. Like this : http://sgh.dk/~sgh/classes.png

It looks very nice. Now I save the model and closes the file. When I read in the file again (whithout closing umbrello, it looks like this : http://sgh.dk/~sgh/classes2.png 

If I'm using directional associations, the association becomes inheritance after a diagram reload.
Comment 1 Oliver Kellogg 2005-06-01 23:37:00 UTC
Wow.
Comment 2 Oliver Kellogg 2005-06-02 00:45:23 UTC
SVN commit 420991 by okellogg:

resolveRef(): Only consider assoc type change to at_Realization
 if current type is at_Generalization.
BUG:106632


 M  +1 -1      ChangeLog  
 M  +4 -2      umbrello/association.cpp  


--- trunk/KDE/kdesdk/umbrello/ChangeLog #420990:420991
@@ -5,7 +5,7 @@
 * Change interface into class and vice versa (if abstract and no attributes)
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
-57588 67719 79433 87252 88117 105564
+57588 67719 79433 87252 88117 105564 106632
 
 Version 1.4.1 (maintenance release)
 
--- trunk/KDE/kdesdk/umbrello/umbrello/association.cpp #420990:420991
@@ -148,8 +148,10 @@
 	if (successA && successB) {
 		UMLObject *objA = getUMLRole(A)->getObject();
 		UMLObject *objB = getUMLRole(B)->getObject();
-		if (objA && objA->getBaseType() == Uml::ot_Interface ||
-		    objB && objB->getBaseType() == Uml::ot_Interface)
+		// Check if need to change the assoc type to Realization
+		if (m_AssocType == Uml::at_Generalization &&
+		    (objA && objA->getBaseType() == Uml::ot_Interface ||
+		     objB && objB->getBaseType() == Uml::ot_Interface))
 			m_AssocType = Uml::at_Realization;
 		UMLDoc *doc = UMLApp::app()->getDocument();
 		doc->addAssocToConcepts(this);
Comment 3 Oliver Kellogg 2005-06-02 18:16:35 UTC
*** Bug 106673 has been marked as a duplicate of this bug. ***