OpenXML Filter: improve the styles optimisation to support run containers

Issue #952 resolved
Denis Konovalyenko created an issue

A paragraph

        <w:p w:rsidR="003D4623" w:rsidRPr="002C1460" w:rsidRDefault="003D4623"
             w:rsidP="00276FA4">
            <w:pPr>
                <w:rPr>
                    <w:b/>
                    <w:bCs/>
                </w:rPr>
            </w:pPr>
            <w:r w:rsidRPr="002C1460">
                <w:rPr>
                    <w:b/>
                    <w:bCs/>
                </w:rPr>
                <w:t xml:space="preserve">Corporate Headquarters </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:rsidRPr="002C1460">
                        <w:rPr>
                            <w:b/>
                            <w:bCs/>
                        </w:rPr>
                        <w:t>Denmark</w:t>
                    </w:r>
                </w:smartTag>
            </w:smartTag>
        </w:p>

can be written as

        <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">Corporate Headquarters </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>Denmark</w:t>
                    </w:r>
                </w:smartTag>
            </w:smartTag>
        </w:p>

as the Caption paragraph style has w:b and w:bCs properties:

    <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>

For more details please refer to the attached documents.

Comments (3)

  1. Log in to comment