<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>136061</bug_id>
          
          <creation_ts>2006-10-20 23:44:15 +0000</creation_ts>
          <short_desc>JJ: xml scheme: mixup of attribute names: *color and *colour</short_desc>
          <delta_ts>2006-12-27 10:08:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>umbrello</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bastian Fenske">mail</reporter>
          <assigned_to name="Umbrello Development Group">umbrello-devel</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>478639</commentid>
    <comment_count>0</comment_count>
    <who name="Bastian Fenske">mail</who>
    <bug_when>2006-10-20 23:44:15 +0000</bug_when>
    <thetext>Version:           1.5.3 (using KDE 3.5.5, Debian Package 4:3.5.5a-1 (testing/unstable))
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-2-486

Would&apos;t it not be clearer to either use *color or *colour as attribute names of the diagram and widget elemens in the xml scheme?

BE:
classwidget/usesdiagramfillcolour
classwidget/usesdiagramusefillcolour
classwidget/fillcolour
interfacewidget/usesdiagramfillcolour
interfacewidget/usesdiagramusefillcolour
interfacewidget/fillcolour

AE:
diagram/fillcolor
diagram/usefillcolor
diagram/linecolor
classwidget/usefillcolor
classwidget/linecolor
interfacewidget/usefillcolor
interfacewidget/linecolor</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>488368</commentid>
    <comment_count>1</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2006-11-20 21:11:25 +0000</bug_when>
    <thetext>Easy enough for Junior Job. Caveat: Need to continue to support
loading files containing the &quot;ou&quot; spelling for backward compatibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>495656</commentid>
    <comment_count>2</comment_count>
      <attachid>19019</attachid>
    <who name="Michael Palomas">mpalomas</who>
    <bug_when>2006-12-23 18:56:34 +0000</bug_when>
    <thetext>Created attachment 19019
Mixup spelling in xml scheme proposed patch

Hello,

here is my proposed patch for this bug (KDE 3.5 svn branch). Changed *colour to
*color in UMLWidget::saveToXMI , and in loadFromXMI first try to retrieve old
british  spelling to keep backward compatibility, then try with the american
one .

Tested on very simple project file (2 classes with colors changed) which used
the old mixup scheme, loaded correctly, then saved again, .xmi is then
consistent with only *color as expected.

I hope i did not miss more *colour attributes in other source files.

Cheers,

Michael</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>496206</commentid>
    <comment_count>3</comment_count>
    <who name="Oliver Kellogg">okellogg</who>
    <bug_when>2006-12-27 10:08:20 +0000</bug_when>
    <thetext>SVN commit 616890 by okellogg:

Apply attachment 19019 from Michael Palomas:
&gt; Changed *colour to *color in UMLWidget::saveToXMI, and in loadFromXMI first
&gt; try to retrieve old british  spelling to keep backward compatibility, then
&gt; try with the american one.

BUG:136061


 M  +1 -0      ChangeLog  
 M  +13 -4     umbrello/umlwidget.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #616889:616890
@@ -15,6 +15,7 @@
 * Association line nodes don&apos;t drag along with multiply-selected classes (57878)
 * Disappearing parameters when editing class properties (114477)
 * Umbrello saves too much copies at xmi (135606)
+* XML scheme: mixup of attribute names: *color and *colour (136061)
 * Artifacts of a component diagram are wrongly placed in Deployment View folder (137564)
 * Incorrect export to SQL (138139)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidget.cpp #616889:616890
@@ -949,12 +949,13 @@
     qElement.setAttribute( &quot;y&quot;, getY() );
     qElement.setAttribute( &quot;width&quot;, getWidth() );
     qElement.setAttribute( &quot;height&quot;, getHeight() );
-    qElement.setAttribute( &quot;usesdiagramfillcolour&quot;, m_bUsesDiagramFillColour );
-    qElement.setAttribute( &quot;usesdiagramusefillcolour&quot;, m_bUsesDiagramUseFillColour );
+    // for consistency the following attributes now use american spelling for &quot;color&quot;
+    qElement.setAttribute( &quot;usesdiagramfillcolor&quot;, m_bUsesDiagramFillColour );
+    qElement.setAttribute( &quot;usesdiagramusefillcolor&quot;, m_bUsesDiagramUseFillColour );
     if (m_bUsesDiagramFillColour) {
-        qElement.setAttribute( &quot;fillcolour&quot;, &quot;none&quot; );
+        qElement.setAttribute( &quot;fillcolor&quot;, &quot;none&quot; );
     } else {
-        qElement.setAttribute( &quot;fillcolour&quot;, m_FillColour.name() );
+        qElement.setAttribute( &quot;fillcolor&quot;, m_FillColour.name() );
     }
     qElement.setAttribute(&quot;isinstance&quot;, m_bIsInstance);
     if (!m_instanceName.isEmpty())
@@ -972,9 +973,17 @@
     QString y = qElement.attribute( &quot;y&quot;, &quot;0&quot; );
     QString h = qElement.attribute( &quot;height&quot;, &quot;0&quot; );
     QString w = qElement.attribute( &quot;width&quot;, &quot;0&quot; );
+    /*
+      For the next three *color attributes, there was a mixup of american and english spelling for &quot;color&quot;.
+      So first we need to keep backward compatibility and try to retrieve the *colour attribute.
+      Next we overwrite this value if we find a *color, otherwise the former *colour is kept.
+    */
     QString fillColour = qElement.attribute( &quot;fillcolour&quot;, &quot;none&quot; );
+    fillColour = qElement.attribute( &quot;fillcolor&quot;, fillColour );
     QString usesDiagramFillColour = qElement.attribute( &quot;usesdiagramfillcolour&quot;, &quot;1&quot; );
+    usesDiagramFillColour = qElement.attribute( &quot;usesdiagramfillcolor&quot;, usesDiagramFillColour );
     QString usesDiagramUseFillColour = qElement.attribute( &quot;usesdiagramusefillcolour&quot;, &quot;1&quot; );
+    usesDiagramUseFillColour = qElement.attribute( &quot;usesdiagramusefillcolor&quot;, usesDiagramUseFillColour );
 
     m_nId = STR2ID(id);
 
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19019</attachid>
            <date>2006-12-23 18:56:34 +0000</date>
            <delta_ts>2006-12-23 18:56:34 +0000</delta_ts>
            <desc>Mixup spelling in xml scheme proposed patch</desc>
            <filename>umbrello_bug_136061.diff</filename>
            <type>text/plain</type>
            <size>2226</size>
            <attacher name="Michael Palomas">mpalomas</attacher>
            
              <data encoding="base64">SW5kZXg6IHVtYnJlbGxvL3VtbHdpZGdldC5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gdW1icmVsbG8vdW1s
d2lkZ2V0LmNwcAkocul2aXNpb24gNjE1OTYxKQorKysgdW1icmVsbG8vdW1sd2lkZ2V0LmNwcAko
Y29waWUgZGUgdHJhdmFpbCkKQEAgLTk0OSwxMiArOTQ5LDEzIEBACiAgICAgcUVsZW1lbnQuc2V0
QXR0cmlidXRlKCAieSIsIGdldFkoKSApOwogICAgIHFFbGVtZW50LnNldEF0dHJpYnV0ZSggIndp
ZHRoIiwgZ2V0V2lkdGgoKSApOwogICAgIHFFbGVtZW50LnNldEF0dHJpYnV0ZSggImhlaWdodCIs
IGdldEhlaWdodCgpICk7Ci0gICAgcUVsZW1lbnQuc2V0QXR0cmlidXRlKCAidXNlc2RpYWdyYW1m
aWxsY29sb3VyIiwgbV9iVXNlc0RpYWdyYW1GaWxsQ29sb3VyICk7Ci0gICAgcUVsZW1lbnQuc2V0
QXR0cm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