[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello

Matthias Kretz kretz at kde.org
Sun Dec 25 08:41:02 UTC 2005


SVN commit 491329 by mkretz:

Fix the attribute name in the XMI files to be linecolor instead of linecolour.
With this change old versions of Umbrello will not be able to read the saved
linecolor of new versions anymore. But I don't that that matters as Umbrello
wasn't able to load the linecolors anyways before my previous commit.


 M  +10 -5     widgetbase.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/widgetbase.cpp #491328:491329
@@ -82,9 +82,9 @@
 
 void WidgetBase::saveToXMI( QDomDocument & /*qDoc*/, QDomElement & qElement ) {
     if (m_bUsesDiagramLineColour) {
-        qElement.setAttribute( "linecolour", "none" );
+        qElement.setAttribute( "linecolor", "none" );
     } else {
-        qElement.setAttribute( "linecolour", m_LineColour.name() );
+        qElement.setAttribute( "linecolor", m_LineColour.name() );
     }
     if (m_bUsesDiagramLineWidth) {
         qElement.setAttribute( "linewidth", "none" );
@@ -94,10 +94,15 @@
 }
 
 bool WidgetBase::loadFromXMI( QDomElement & qElement ) {
-    QString lineColour = qElement.attribute( "linecolour", "none" );
+    // first load from "linecolour" and then overwrite with the "linecolor"
+    // attribute if that one is present. The "linecolour" name was a "typo" in
+    // earlier versions of Umbrello
+    QString lineColor = qElement.attribute( "linecolour", "none" );
+    lineColor = qElement.attribute( "linecolor", lineColor );
+
     QString lineWidth = qElement.attribute( "linewidth", "none" );
-    if (lineColour != "none") {
-        setLineColor( QColor(lineColour) );
+    if (lineColor != "none") {
+        setLineColor( QColor(lineColor) );
         m_bUsesDiagramLineColour = false;
     } else if (m_Type != Uml::wt_Box && m_pView != NULL) {
         setLineColor( m_pView->getLineColor() );




More information about the umbrello-devel mailing list