[Uml-devel] KDE_3_4_BRANCH: kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Sun Apr 3 22:31:44 UTC 2005


CVS commit by okellogg: 

Backport patch by Lutz Mueller for bug 103133.


  M +19 -20    umlview.cpp   1.207.2.4


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.207.2.3:1.207.2.4
@@ -3361,30 +3361,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