Bug 67735

Summary: document that is not saved/reopened properly
Product: kword Reporter: Pupeno <pupeno>
Component: generalAssignee: Thomas Zander <zander>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Example document

Description Pupeno 2003-11-10 01:40:19 UTC
Version:           3.0rc1 (using KDE KDE 3.1.4)
Installed from:    Unspecified Linux
OS:          Linux

I have a document (that I'll hope to attach here) that has some words underlined, I saved and when I reopened everything was underlined.
Comment 1 Pupeno 2003-11-10 01:44:46 UTC
Created attachment 3120 [details]
Example document

This is the document that demostrates the bug.
Comment 2 David Faure 2003-11-10 08:17:31 UTC
Subject: Re:  document that is not saved/reopened properly

The bug must be on saving, because in the .kwd file, there are indeed <UNDERLINE> tags
for almost every paragraph.
So I don't know how to debug this - the document 'looks fine', i.e. opening it shows what's in the XML.
The question is, how to reproduce this bug? Can you reproduce it, and provide step-by-step instructions?

Comment 3 Pupeno 2003-11-10 16:10:24 UTC
Yes, it is simple:
1) Open the file.
2) Select something (some letters, some words).
3) Remove the underline.
3) Save the file.
4) Close the file.
5) Open the file again, everything is underlined.
Thanks.
Comment 4 David Faure 2003-11-16 20:59:03 UTC
Subject: koffice/kword

CVS commit by faure: 

Save "no underline" explicitely if the paraglayout says "underline" but the
user removed the underline (like we do for all other attributes)
CCMAIL: 67735-done@bugs.kde.org


  M +29 -39    kwtextparag.cc   1.257


--- koffice/kword/kwtextparag.cc  #1.256:1.257
@@ -179,6 +179,4 @@ QDomElement KWTextParag::saveFormat( QDo
         || curFormat->wordByWord() != refFormat->wordByWord())
     {
-        if ( curFormat->underlineType()!= KoTextFormat::U_NONE )
-        {
             elem = doc.createElement( "UNDERLINE" );
             formatElem.appendChild( elem );
@@ -198,5 +196,4 @@ QDomElement KWTextParag::saveFormat( QDo
             elem.setAttribute( "wordbyword" , static_cast<int>(curFormat->wordByWord()));
         }
-    }
     if( !refFormat
         || curFormat->strikeOutType() != refFormat->strikeOutType()
@@ -204,6 +201,4 @@ QDomElement KWTextParag::saveFormat( QDo
         || curFormat->wordByWord() != refFormat->wordByWord())
     {
-        if ( curFormat->strikeOutType()!= KoTextFormat::S_NONE )
-        {
             elem = doc.createElement( "STRIKEOUT" );
             formatElem.appendChild( elem );
@@ -217,6 +212,4 @@ QDomElement KWTextParag::saveFormat( QDo
             elem.setAttribute( "styleline", strLineType );
             elem.setAttribute( "wordbyword" , static_cast<int>(curFormat->wordByWord()));
-
-        }
     }
     if( !refFormat || (curFormat->vAlign() != refFormat->vAlign())
@@ -262,10 +255,7 @@ QDomElement KWTextParag::saveFormat( QDo
     if( !refFormat || curFormat->offsetFromBaseLine() != refFormat->offsetFromBaseLine())
     {
-        if ( curFormat->offsetFromBaseLine() != 0)
-        {
             elem = doc.createElement( "OFFSETFROMBASELINE" );
             formatElem.appendChild( elem );
             elem.setAttribute( "value", curFormat->offsetFromBaseLine() );
-        }
     }
     if( !refFormat || curFormat->attributeFont() != refFormat->attributeFont())