Bug 246067

Summary: Applying a Character style doesn't get saved properly.
Product: kword Reporter: Marcus Harrison <marcus>
Component: opendocumentAssignee: Thomas Zander <zander>
Status: RESOLVED FIXED    
Severity: normal Keywords: release_blocker
Priority: NOR    
Version: 2.2   
Target Milestone: Persona: Susan   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: "Test.odt", a file to demonstrate the loss of formatting. Has the, "code" character type in two separate places.
"Test.odt" formatted and saved in OpenOffice.org.

Description Marcus Harrison 2010-07-28 19:31:49 UTC
Created attachment 49599 [details]
"Test.odt", a file to demonstrate the loss of formatting. Has the, "code" character type in two separate places.

Version:           2.2
OS:                Linux

After I have created a new custom character set and applied it to text (belonging to a paragraph of a type separate from the character set: it has no parent paragraph type, after all), saving and closing the document results in all the text of that paragraph reverting back to the paragraph's character style.

Reproducible: Always
Comment 1 Marcus Harrison 2010-07-28 19:33:53 UTC
Created attachment 49600 [details]
"Test.odt" formatted and saved in OpenOffice.org.

Opening this file in either KWord or OpenOffice.org Writer reveals that the application of the character type, "Code" has been preserved.
Comment 2 Thomas Zander 2010-11-07 15:58:53 UTC
It looks like the loading of an auto-style (family "text") that has as a parent a non-auto-style forgets to set the proper style Id on the document.
Comment 3 Thomas Zander 2010-11-07 19:03:49 UTC
SVN commit 1193959 by zander:

Fix loading of character styles to remember the name.

In many cases a character style applied to a smaller piece of text
will have an automatic-style introduced in between to store any extra
properties.  It is important to remember the parent on loading since
otherwise the text just becomes an anonymous piece of formatted
text and we loose the whole advantage of characters styles.

This commit makes sure that we keep this relationship in tact.

BUG:246067

 M  +27 -16    KoTextSharedLoadingData.cpp  
 M  +7 -1      KoTextSharedLoadingData.h  
 M  +6 -0      tests/CMakeLists.txt  
 A             tests/data/TextContents/TextFormatting/charStyle.odt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1193959