https://bugs.freedesktop.org/show_bug.cgi?id=68183

          Priority: medium
            Bug ID: 68183
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: FILESAVE: Unnecessary automatic styles in
                    "content.xml"
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: holger.schmithue...@awi.de
          Hardware: Other
        Whiteboard: BSA
            Status: UNCONFIRMED
           Version: 4.0.3.3 release
         Component: Writer
           Product: LibreOffice

Problem description:
When creating paragraphs using existing styles, Writer creates automatic styles
for each individual paragraph (also for headings) in "content.xml" (document
saved as odt or fodt) . This creates unnecessary and confusing overhead in the
xml-file like:

<office:automatic-styles>
<style:style style:name="P1" style:family="paragraph"
style:parent-style-name="Text_20_body">
<style:text-properties officeooo:paragraph-rsid="00063317"/>
</style:style>
<style:style style:name="P2" style:family="paragraph"
style:parent-style-name="Title">
<style:text-properties officeooo:paragraph-rsid="00063317"/>
</style:style>
<style:style style:name="T1" style:family="text">
<style:text-properties officeooo:rsid="00063317"/>
</style:style>
</office:automatic-styles>

Whereas the actual content reads:

<office:body>
<office:text>
<text:p text:style-name="P2"><text:span text:style-name="T1">This is my
title</text:span></text:p>
<text:p text:style-name="P1"><text:span text:style-name="T1">This is a text
body paragraph.</text:span></text:p>
</office:text>
</office:body> 

When manually removing direct formatting (by selecting all text and clicking
"Format - Clear direct formatting"), the same information is stored already a
bit cleaner, but still with the unused and useless style "T1":

<office:automatic-styles>
<style:style style:name="T1" style:family="text">
<style:text-properties officeooo:rsid="00063317"/>
</style:style>
</office:automatic-styles>

<office:body>
<office:text>
<text:p text:style-name="Title">This is my title</text:p>
<text:p text:style-name="Text_20_body">This is a text body paragraph.</text:p>
</office:text>
</office:body> 

When manually reassigning the styles to each paragraph (by selecting each
paragraph and double clicking on the respective style), the same information is
stored straight and clean:

<office:automatic-styles/>

<office:body>
<office:text>
<text:p text:style-name="Title">This is my title</text:p>
<text:p text:style-name="Text_20_body">This is a text body paragraph.</text:p>
</office:text>
</office:body> 

Steps to reproduce:
1. Open a new Writer document
2. Open the styles window (F11)
3. Select the style "Title"
4. Enter a title "This is my title"
5. Select the style "Text Body"
6. Enter a paragraph "This is a text body paragraph."
7. Save as odt or fodt: Three (unnecessary) automatic styles are saved
now either:
8a. Remove all direct formatting by clicking "Format - Clear direct formatting"
9a. Save again: The content is clean, but <office:automatic-styles> keeps the
useless element named "T1".
or alternatively:
8b. Click in the title and then double click on the style "Title"
9b. Click in the text paragraph and then double click on the style "Text Body"
10b. Save again: This removes unnecessary automatic styles completely and saves
the content nice and clean.

Current behavior:
See above steps 7. and 9a.

Expected behavior:
See above step 10b. This should be the default behaviour without doing steps 8b
and 9b.

Thanks for improvement!
Holger
Operating System: All
Version: 4.0.3.3 release

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to