ODF Styles Parser: Child styles should inherit attributes from their parent style
For instance, in sc/res/xml/styles.xml file of the LibreOffice source code, we have the following:
<?xml version="1.0"?>
<office:styles xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0">
<style:style style:name="Heading" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties fo:color="#000000" fo:font-size="24pt" fo:font-style="normal" fo:font-weight="bold"/>
</style:style>
<style:style style:name="Heading 1" style:family="table-cell" style:parent-style-name="Heading">
<style:text-properties fo:font-size="18pt"/>
</style:style>
<style:style style:name="Heading 2" style:family="table-cell" style:parent-style-name="Heading">
<style:text-properties fo:font-size="12pt"/>
</style:style>
...
</office:styles>
The style named "Heading" has the fo:font-weight="bold" attribute. "Heading 1" and "Heading 2" uses "Heading" as their parent, thus the font weight for Heading 1 and Heading 2 should be bold. However, in the current Orcus code, they are treated as non-bold by the default value "false" in text_prop_attr_parser::text_prop_attr_parser, see src/liborcus/odf_styles_context.cpp:158. The same issue exists for italic etc attributes.
For each attribute, we should first check if there is an explicit setting for this attribute in this element; if not, check its direct parent, up until the top parent.
Observed in libreoffice bug report https://bugs.documentfoundation.org/show_bug.cgi?id=103331 (Child styles not inheriting from parent, 2016-10-19 13:12 UTC reported by Yousuf Philips).