Bug 67735 - document that is not saved/reopened properly
Summary: document that is not saved/reopened properly
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-10 01:40 UTC by Pupeno
Modified: 2003-11-16 20:59 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example document (8.23 KB, application/octet-stream)
2003-11-10 01:44 UTC, Pupeno
Details

Note You need to log in before you can comment on or make changes to this bug.
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())