[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Apr 3 21:36:47 UTC 2005
CVS commit by okellogg:
Patch by Pyry Liukas (pyry_AT_liukas.fi) removes sensitivity to order
of elements in the <diagrams> tag.
M +19 -20 umlview.cpp 1.214
--- kdesdk/umbrello/umbrello/umlview.cpp #1.213:1.214
@@ -3385,30 +3385,29 @@ bool UMLView::loadFromXMI( QDomElement &
m_Options.uiState.lineWidth = linewidth.toInt();
m_nLocalID = localid.toInt();
- //load the widgets
+
QDomNode node = qElement.firstChild();
+ bool widgetsLoaded = false, messagesLoaded = false, associationsLoaded = false;
+ while (!node.isNull()) {
QDomElement element = node.toElement();
- if( !element.isNull() && element.tagName() != "widgets" )
- return false;
- if( !loadWidgetsFromXMI( element ) ) {
- kdWarning() << "failed umlview load on widgets" << endl;
- return false;
+ if (!element.isNull()) {
+ if (element.tagName() == "widgets")
+ widgetsLoaded = loadWidgetsFromXMI( element );
+ else if (element.tagName() == "messages")
+ messagesLoaded = loadMessagesFromXMI( element );
+ else if (element.tagName() == "associations")
+ associationsLoaded = loadAssociationsFromXMI( element );
+ }
+ node = node.nextSibling();
}
- //load the message widgets
- node = element.nextSibling();
- element = node.toElement();
- if( !element.isNull() && element.tagName() != "messages" )
+ if (!widgetsLoaded) {
+ kdWarning() << "failed umlview load on widgets" << endl;
return false;
- if( !loadMessagesFromXMI( element ) ) {
+ }
+ if (!messagesLoaded) {
kdWarning() << "failed umlview load on messages" << endl;
return false;
}
-
- //load the associations
- node = element.nextSibling();
- element = node.toElement();
- if( !element.isNull() && element.tagName() != "associations" )
- return false;
- if( !loadAssociationsFromXMI( element ) ) {
+ if (!associationsLoaded) {
kdWarning() << "failed umlview load on associations" << endl;
return false;
More information about the umbrello-devel
mailing list