OpenXML Filter: the styles optimisation is performed imprecisely when a selected paragraph style has paragraph properties

Issue #955 resolved
Denis Konovalyenko created an issue

Please consider the following snippets.

Input document:

                    <w:p>
                        <w:pPr>
                            <w:rPr>
                                <w:b/>
                                <w:bCs/>
                            </w:rPr>
                        </w:pPr>
                        <w:r>
                            <w:rPr>
                                <w:b/>
                                <w:bCs/>
                            </w:rPr>
                            <w:t xml:space="preserve">orporatecay eadquartershay </w:t>
                        </w:r>
                        <w:smartTag w:uri="urn:schemas-microsoft-com:office:smarttags"
                                    w:element="place">
                            <w:smartTag w:uri="urn:schemas-microsoft-com:office:smarttags"
                                        w:element="country-region">
                                <w:r>
                                    <w:rPr>
                                        <w:b/>
                                        <w:bCs/>
                                    </w:rPr>
                                    <w:t>enmarkday</w:t>
                                </w:r>
                            </w:smartTag>
                        </w:smartTag>
                    </w:p>
                    <w:p>
                        <w:r>
                            <w:t xml:space="preserve">eltay. +45 44 85 95 00</w:t>
                        </w:r>
                    </w:p>

Output:

<w:p>
    <w:pPr>
        <w:rPr>
            <w:b/>
            <w:bCs/>
        </w:rPr>
        <w:pStyle w:val="Caption"/>
    </w:pPr>
    <w:r>
        <w:t xml:space="preserve">orporatecay eadquartershay </w:t>
    </w:r>
    <w:smartTag w:uri="urn:schemas-microsoft-com:office:smarttags"
                w:element="place">
        <w:smartTag w:uri="urn:schemas-microsoft-com:office:smarttags"
                    w:element="country-region">
            <w:r>
                <w:t>enmarkday</w:t>
            </w:r>
        </w:smartTag>
    </w:smartTag>
</w:p>
<w:p>
    <w:r>
        <w:t xml:space="preserve">eltay. +45 44 85 95 00</w:t>
    </w:r>
</w:p>

The selected style:

    <w:style w:type="paragraph" w:styleId="Caption">
        <w:name w:val="caption"/>
        <w:basedOn w:val="Normal"/>
        <w:next w:val="Normal"/>
        <w:uiPriority w:val="99"/>
        <w:qFormat/>
        <w:rsid w:val="00FD08BB"/>
        <w:pPr>
            <w:spacing w:before="240" w:after="240"/>
        </w:pPr>
        <w:rPr>
            <w:b/>
            <w:bCs/>
        </w:rPr>
    </w:style>

The style has <w:spacing w:before="240" w:after="240"/> in its paragraph properties, however, the input document does not have any paragraph properties, except for the paragraph mark

Thus, the resulted UI looks differently.

Expected:

Actual:

For more details please refer to the attached documents.

Comments (3)

  1. Log in to comment