OpenXML Filter: the very first Word general style is mistakenly removed

Issue #878 resolved
Denis Konovalyenko created an issue

The situation happens when Word style.xml part does not have document defaults nor latent styles. Thus, the very first style is lost on reading.

For instance, if we have the following styles part content:

<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
    <w:style w:styleId="style0" w:type="paragraph">
        <w:name w:val="Normal"/>
        <w:next w:val="style0"/>
        <w:pPr>
            <w:widowControl/>
            <w:tabs>
                <w:tab w:leader="none" w:pos="720" w:val="left"/>
            </w:tabs>
            <w:suppressAutoHyphens w:val="true"/>
            <w:spacing w:after="200" w:before="0" w:line="276" w:lineRule="auto"/>
        </w:pPr>
        <w:rPr>
            <w:rFonts w:ascii="Calibri" w:cs="Calibri" w:eastAsia="Calibri" w:hAnsi="Calibri"/>
            <w:color w:val="auto"/>
            <w:sz w:val="22"/>
            <w:szCs w:val="22"/>
            <w:lang w:bidi="ar-SA" w:eastAsia="zh-CN" w:val="en-US"/>
        </w:rPr>
    </w:style>
    <w:style w:styleId="style15" w:type="character">
        <w:name w:val="Default Paragraph Font"/>
        <w:next w:val="style15"/>
        <w:rPr></w:rPr>
    </w:style>
...

it appears as

<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
    <w:style w:styleId="style15" w:type="character">
        <w:name w:val="Default Paragraph Font"/>
        <w:next w:val="style15"/>
    </w:style>
 ...

after filtering.

For a complete package example please refer to the attached document.

Comments (3)

  1. Log in to comment