[Uml-devel] branches/KDE/3.5/kdesdk/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sat Jul 21 17:36:11 UTC 2007


SVN commit 690647 by okellogg:

loadFromXMI(): If the xmi.id of an UMLRole is already in use then generate a new one.
CCBUG:147988


 M  +1 -0      ChangeLog  
 M  +15 -3     umbrello/umlobject.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #690646:690647
@@ -9,6 +9,7 @@
 * Crash when changing the association type to containment (147202)
 * Moving component on diagram results in absurd shape of self-association (147810)
 * Crash when changing the attribute name (147919)
+* Reads XMI exported by version 1.5 but crashes when rereading after saving (147988)
 
 Version 1.5.71
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #690646:690647
@@ -565,6 +565,18 @@
         }
     } else {
         m_nId = STR2ID(id);
+        if (m_BaseType == Uml::ot_Role) {
+            // Some older Umbrello versions had a problem with xmi.id's
+            // of other objects being reused for the UMLRole, see e.g.
+            // attachment 21179 at http://bugs.kde.org/147988 .
+            // If the xmi.id is already being used then we generate a new one.
+            UMLObject *o = umldoc->findObjectById(m_nId);
+            if (o) {
+                kDebug() << "loadFromXMI(UMLRole): id " << id
+                    << " is already in use, generating a new one." << endl;
+                m_nId = UniqueID::gen();
+            }
+        }
     }
 
     if (element.hasAttribute("documentation"))  // for bkwd compat.
@@ -647,11 +659,11 @@
                 if (vis.isEmpty())
                     vis = elem.text();
                 if (vis == "private" || vis == "private_vis")
-                      m_Vis = Uml::Visibility::Private;
+                    m_Vis = Uml::Visibility::Private;
                 else if (vis == "protected" || vis == "protected_vis")
-                  m_Vis = Uml::Visibility::Protected;
+                    m_Vis = Uml::Visibility::Protected;
                 else if (vis == "implementation")
-                  m_Vis = Uml::Visibility::Implementation;
+                    m_Vis = Uml::Visibility::Implementation;
             } else if (Uml::tagEq(tag, "isAbstract")) {
                 QString isAbstract = elem.attribute("xmi.value", "");
                 if (isAbstract.isEmpty())




More information about the umbrello-devel mailing list