[Uml-devel] kdesdk/umbrello/umbrello

Brian Thomas thomas at mail630.gsfc.nasa.gov
Thu Dec 4 09:50:03 UTC 2003


CVS commit by thomas: 

bug fix: codeclassfield could get confused about what type of association/role it was related to because of poor initialization, eventually, sometimes, causing a crash


  M +1 -1      association.cpp   1.27
  M +6 -2      codeclassfield.cpp   1.15
  M +1 -0      codeclassfield.h   1.7


--- kdesdk/umbrello/umbrello/association.cpp  #1.26:1.27
@@ -25,5 +25,5 @@ UMLAssociation::UMLAssociation( UMLDoc* 
                                 Association_Type type,
                                 UMLObject * roleA, UMLObject * roleB )
-    : UMLObject(parent) 
+    : UMLObject(parent, "", -1) 
 {
         init(type, roleA, roleB);

--- kdesdk/umbrello/umbrello/codeclassfield.h  #1.6:1.7
@@ -204,4 +204,5 @@ private:
         CodeClassFieldDeclarationBlock * m_declCodeBlock;
         QPtrList<CodeAccessorMethod> m_methodVector; // the list of methods related to this codeclassfield
+        bool m_parentIsAttribute;
 
         // these are just some utility functions 

--- kdesdk/umbrello/umbrello/codeclassfield.cpp  #1.14:1.15
@@ -80,4 +80,5 @@ void CodeClassField::setParentUMLObject 
                 UMLAssociation * parentAssoc = role->getParentAssociation();
                 Uml::Association_Type atype = parentAssoc->getAssocType();
+                m_parentIsAttribute = false;
 
                 if (atype == Uml::at_Association)
@@ -87,6 +88,8 @@ void CodeClassField::setParentUMLObject 
                 else if (atype == Uml::at_Composition)
                         m_classFieldType = Composition;
-        } else
+        } else {
                 m_classFieldType = Attribute;
+                m_parentIsAttribute = true;
+        }
 }
 
@@ -131,5 +134,6 @@ QString CodeClassField::getListObjectTyp
  */
 bool CodeClassField::parentIsAttribute ( ) {
-        return (m_classFieldType == Attribute) ? true : false;
+        return m_parentIsAttribute;
+//      return (m_classFieldType == Attribute) ? true : false;
 }
 






More information about the umbrello-devel mailing list