[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Thu Dec 23 08:01:01 UTC 2004
CVS commit by okellogg:
<quote maalanen_AT_ra.abo.fi>
Adding containment between a Class and another Class makes it
use the "feature" property, which is incorrect (very much so, since
feature ought to contain Feature-types, not Classes). It should use
"ownedElement" instead.
</quote>
CCMAIL:56184
M +9 -5 class.cpp 1.51
M +12 -8 interface.cpp 1.26
--- kdesdk/umbrello/umbrello/class.cpp #1.50:1.51
@@ -222,11 +222,15 @@ void UMLClass::saveToXMI( QDomDocument &
newTemplate->saveToXMI(qDoc, featureElement);
}
+ if (featureElement.hasChildNodes())
+ classElement.appendChild( featureElement );
//save contained objects
+ if (m_objects.count()) {
+ QDomElement ownedElement = qDoc.createElement( "UML:Namespace.ownedElement" );
for (UMLObjectListIt oit(m_objects); oit.current(); ++oit) {
UMLObject *obj = oit.current();
- obj->saveToXMI (qDoc, featureElement);
+ obj->saveToXMI (qDoc, ownedElement);
+ }
+ classElement.appendChild( ownedElement );
}
- if (featureElement.hasChildNodes())
- classElement.appendChild( featureElement );
qElement.appendChild( classElement );
}
--- kdesdk/umbrello/umbrello/interface.cpp #1.25:1.26
@@ -52,16 +52,20 @@ void UMLInterface::init() {
void UMLInterface::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
QDomElement interfaceElement = UMLObject::save("UML:Interface", qDoc);
- QDomElement featureElement = qDoc.createElement( "UML:Classifier.feature" );
//save operations
UMLOperationList opsList = getOpList();
- UMLOperation* pOp = 0;
- for ( pOp = opsList.first(); pOp != 0; pOp = opsList.next() ) {
+ if (opsList.count()) {
+ QDomElement featureElement = qDoc.createElement( "UML:Classifier.feature" );
+ for (UMLOperation *pOp = opsList.first(); pOp; pOp = opsList.next() ) {
pOp->saveToXMI(qDoc, featureElement);
}
+ interfaceElement.appendChild( featureElement );
+ }
//save contained objects
+ if (m_objects.count()) {
+ QDomElement ownedElement = qDoc.createElement( "UML:Namespace.ownedElement" );
for (UMLObject *obj = m_objects.first(); obj; obj = m_objects.next())
- obj->saveToXMI (qDoc, featureElement);
- if (featureElement.hasChildNodes())
- interfaceElement.appendChild( featureElement );
+ obj->saveToXMI (qDoc, ownedElement);
+ interfaceElement.appendChild( ownedElement );
+ }
qElement.appendChild( interfaceElement );
}
More information about the umbrello-devel
mailing list