[Uml-devel] kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Thu Apr 15 01:50:02 UTC 2004


CVS commit by okellogg: 

copyInto(): Fix bug 79631 ('Duplicate' makes class with same name.)


  M +5 -2      umlobject.cpp   1.29


--- kdesdk/umbrello/umbrello/umlobject.cpp  #1.28:1.29
@@ -144,6 +144,7 @@ bool UMLObject::operator==(UMLObject & r
 void UMLObject::copyInto(UMLObject *rhs) const
 {
+        UMLDoc *umldoc = UMLApp::app()->getDocument();
+
         // Data members with copy constructor
-        rhs->m_Name = m_Name;
         rhs->m_Doc = m_Doc;
         rhs->m_Stereotype = m_Stereotype;
@@ -153,4 +154,7 @@ void UMLObject::copyInto(UMLObject *rhs)
         rhs->m_Scope = m_Scope;
 
+        // We don't want the same name existing twice.
+        rhs->m_Name = umldoc->uniqObjectName(m_BaseType, m_Name);
+
         // Copy only if not NULL.
         if (m_pUMLPackage != NULL)
@@ -158,5 +162,4 @@ void UMLObject::copyInto(UMLObject *rhs)
 
         // Create a new ID.
-        UMLDoc* umldoc = UMLApp::app()->getDocument();
         rhs->m_nId = umldoc->getUniqueID();
 






More information about the umbrello-devel mailing list