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

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


SVN commit 491331 by mkretz:

forward port from 3.5 branch:
Fix the attribute name in the XMI files to be linecolor instead of linecolour.


 M  +10 -5     widgetbase.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/widgetbase.cpp #491330:491331
@@ -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