Summary: | Reads XMI exported by version 1.5, but crashes when rereading after saving in Umbrello 1.5.7 | ||
---|---|---|---|
Product: | [Applications] umbrello | Reporter: | Soren Roug <soren> |
Component: | general | Assignee: | Oliver Kellogg <okellogg> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
XMI file created by version 1.5
corrected XMI file |
Description
Soren Roug
2007-07-18 20:19:34 UTC
Created attachment 21179 [details]
XMI file created by version 1.5
Open this file in Umbrello 1.5.7, click save, then open it again. It make
Umbrello crash.
Confirm with SVN branches/KDE/3.5 of today. Created attachment 21182 [details]
corrected XMI file
The problem was that apparently the older version generated conflicting
xmi.id's for <UML:Association.connection> (i.e. UMLRole) items.
I simply prefixed thse xmi.id's with "r" to make them unique.
The file saved by 1.5.71 now loads but there may still be more duplicated xmi.id's, please check. 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 [details] 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()) |