From kde-commits Fri Sep 02 18:34:25 2005 From: Oliver Kellogg Date: Fri, 02 Sep 2005 18:34:25 +0000 To: kde-commits Subject: branches/KDE/3.5/kdesdk/umbrello/umbrello Message-Id: <1125686065.470821.1974.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=112568607718992 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(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"); */