pydocx
pydocx copied to clipboard
Implement 'effective_properties' for paragraphs
Paragraphs need to walk the style hierarchy chain and apply properties, just like Runs.
This means that the following numbering doesn't work:
document.xml
<w:p>
<w:pPr>
<w:pStyle w:val="Level2"/>
</w:pPr>
<w:r>
<w:t>Foo</w:t>
</w:r>
</w:p>
styles.xml
<w:style w:type="paragraph" w:customStyle="1" w:styleId="Level2">
<w:name w:val="Level 2"/>
<w:basedOn w:val="Normal"/>
<w:rsid w:val="006F70DD"/>
<w:pPr>
<w:numPr>
<w:ilvl w:val="1"/>
<w:numId w:val="2"/>
</w:numPr>
<w:spacing w:before="240"/>
<w:ind w:right="-360"/>
<w:outlineLvl w:val="1"/>
</w:pPr>
</w:style>
The above should appear numbered, but it doesn't because the numPr within the pPr of the Level2 style is not inherited.