[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Dec 22 22:08:34 UTC 2006
SVN commit 615835 by okellogg:
fixes from loading Poseidon 4.1 xmi
M +1 -19 operation.cpp
M +12 -3 umldoc.cpp
M +0 -32 umlobject.cpp
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/operation.cpp #615834:615835
@@ -324,19 +324,7 @@
}
bool UMLOperation::load( QDomElement & element ) {
- QString type = element.attribute( "type", "" );
- if (!type.isEmpty()) {
- if (type.contains( QRegExp("\\D") )) {
- m_SecondaryId = type; // defer type resolution
- } else {
- UMLDoc *pDoc = UMLApp::app()->getDocument();
- m_pSecondary = pDoc->findObjectById( STR2ID(type) );
- if (m_pSecondary == NULL) {
- kError() << "UMLOperation::load: Cannot find UML object"
- << " for return type " << type << endl;
- }
- }
- }
+ m_SecondaryId = element.attribute( "type", "" );
QString isQuery = element.attribute( "isQuery", "" );
if (!isQuery.isEmpty()) {
// We need this extra test for isEmpty() because load() might have been
@@ -403,7 +391,6 @@
if (m_SecondaryId.isEmpty()) {
kError() << "UMLOperation::load(" << m_Name << "): "
<< "cannot find return type." << endl;
- return false;
}
}
// Use deferred xmi.id resolution.
@@ -420,11 +407,6 @@
pAtt->setParmKind(Uml::pd_InOut);
else
pAtt->setParmKind(Uml::pd_In);
- Uml::IDType id = pAtt->getID();
- if (ID2STR(id).contains( QRegExp("\\D") )) {
- (void) UniqueID::gen();
- // This counts up UMLDoc::m_HighestIDForForeignFile.
- }
m_List.append( pAtt );
}
}
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #615834:615835
@@ -1695,8 +1695,12 @@
bool status = pObject -> loadFromXMI( tempElement );
if ( !status ) {
- delete pObject;
- return false;
+ //delete pObject;
+ // Unfortunately we cannot do this because the pObject
+ // may be still referenced by other model objects.
+ kError() << "loadFromXMI failed for " << pObject->getName() << " xmi.id="
+ << ID2STR(pObject->getID()) << endl;
+ continue;
}
pkg = pObject->getUMLPackage();
if (ot == ot_Stereotype) {
@@ -1717,7 +1721,12 @@
}
continue;
}
- pkg->addObject(pObject);
+ if (pkg == NULL)
+ kError() << "UMLDoc::loadUMLObjectsFromXMI: pkg is NULL for "
+ << pObject->getName() << " xmi.id="
+ << ID2STR(pObject->getID()) << endl;
+ else
+ pkg->addObject(pObject);
/* FIXME see comment at loadUMLObjectsFromXMI
emit sigSetStatusbarProgress( ++m_count );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #615834:615835
@@ -618,38 +618,6 @@
m_bStatic = (ownerScope == "classifier");
}
- /**** Handle XMI_FLAT_PACKAGES and old files *************************/
- QString pkg = element.attribute( "packageid", "-1" );
- // Some interim versions used "packageid" so test for it.
- Uml::IDType pkgId = Uml::id_None;
- if (pkg != "-1") {
- pkgId = STR2ID(pkg);
- } else {
- pkg = element.attribute( "package", "" );
- if (! pkg.isEmpty()) {
- if (pkg.contains(QRegExp("\\D")))
- // Old versions saved the package name instead of the xmi.id.
- setPackage( pkg );
- else
- pkgId = STR2ID(pkg);
- }
- }
- if (pkgId != Uml::id_None) {
- UMLObject *pkgObj = umldoc->findObjectById( pkgId );
- if (pkgObj != NULL) {
- m_pUMLPackage = dynamic_cast<UMLPackage *>(pkgObj);
- if (m_pUMLPackage == NULL) // soft error
- kError() << "UMLObject::loadFromXMI(" << m_Name
- << "): object of packageid "
- << ID2STR(pkgId) << " is not a package" << endl;
- } else { // soft error
- kError() << "UMLObject::loadFromXMI(" << m_Name
- << "): cannot resolve packageid "
- << ID2STR(pkgId) << endl;
- }
- }
- /**** End of XMI_FLAT_PACKAGES and old files handling ****************/
-
// If the node has child nodes, check whether attributes can be
// extracted from them.
if (element.hasChildNodes()) {
More information about the umbrello-devel
mailing list