[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Sep 2 11:35:12 UTC 2005
SVN commit 456388 by okellogg:
Mention mismatch between role_id and Uml::Role_Type.
M +5 -0 ownedcodeblock.cpp
M +3 -1 ownedhierarchicalcodeblock.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/ownedcodeblock.cpp #456387:456388
@@ -84,6 +84,10 @@
if(role)
{
elem.setAttribute("parent_id",ID2STR(role->getParentAssociation()->getID()));
+ // CAUTION: role_id here is numerically inverted wrt Uml::Role_Type,
+ // i.e. role A is 1 and role B is 0.
+ // I'll resist the temptation to change this -
+ // in order to maintain backward compatibility.
elem.setAttribute("role_id", (role->getRole() == Uml::A));
}
else
@@ -126,6 +130,7 @@
// In this case we init with indicated role child obj.
UMLRole * role = 0;
int role_id = elem.attribute("role_id","-1").toInt();
+ // see comment on role_id at setAttributesOnNode()
if(role_id == 1)
role = assoc->getUMLRole(Uml::A);
else if(role_id == 0)
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/ownedhierarchicalcodeblock.cpp #456387:456388
@@ -68,8 +68,10 @@
// as UMLRoles arent properly stored in the XMI right now.
// (change would break the XMI format..save for big version change )
UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
- if(role)
+ if(role) {
+ // see comment on role_id at OwnedCodeBlock::setAttributesOnNode()
elem.setAttribute("role_id", (role->getRole() == Uml::A));
+ }
/* else
elem.setAttribute("role_id","-1");
*/
More information about the umbrello-devel
mailing list