[Libreoffice-bugs] [Bug 139281] New: Unexpected content inserted into XML element in ScDocShell when adding Default style to sc/res/xml/styles.xml

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Dec 28 14:22:16 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=139281

            Bug ID: 139281
           Summary: Unexpected content inserted into XML element in
                    ScDocShell when adding Default style to
                    sc/res/xml/styles.xml
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: ilmari.lauhakangas at libreoffice.org

1. Edit sc/res/xml/styles.xml adding

<style:style style:name="Default" style:family="table-cell">
    <style:text-properties fo:font-size="10pt"/>
</style:style>

2. Run make check (make sc.check might not be enough the first time)

Result is three failed assertions:

ScExportTest::testTdf136721_paper_size finished in: 2703ms
xmltesttools.cxx:194:Assertion
Test name: ScExportTest::testTdf121716_ExportEvenHeaderFooterXLSX
equality assertion failed
- Expected: &Lodd/right&Cpage&Rheader
- Actual  : &L&Kffffffodd/right&C&Kffffffpage&R&Kffffffheader
- In <>, XPath contents of child does not match

xmltesttools.cxx:194:Assertion
Test name: ScExportTest::testTdf134459_HeaderFooterColorXLSX
equality assertion failed
- Expected: &L&Kc06040l&C&K4c3789c&Rr
- Actual  : &L&Kc06040l&C&K4c3789c&R&Kffffffr
- In <>, XPath contents of child does not match

xmltesttools.cxx:194:Assertion
Test name: ScExportTest::testTdf134817_HeaderFooterTextWith2SectionXLSX
equality assertion failed
- Expected: &L&"Abadi,Regular"&11aaa&"Bembo,Regular"&20bbb
- Actual  : &L&"Abadi,Regular"&11&Kffffffaaa&"Bembo,Regular"&20bbb
- In <>, XPath contents of child does not match

This unexpected content is only seen in the ScDocShell and not in the final
exported file.

The unit test file is sc/qa/unit/subsequent_export-test.cxx
The documents are in sc/qa/unit/data/ods and sc/qa/unit/data/xlsx

I was looking into bug 112559 "FILESAVE: ODS - Default cell style font size not
set". It is indeed possible to solve it by editing
sc/source/core/data/stlpool.cxx so it has

#include <editeng/fhgtitem.hxx>

and in ScStyleSheetPool::CreateStandardStyles()

pSet->Put( SvxFontHeightItem( 200, 100, ATTR_FONT_HEIGHT ) ); // 10pt

However, I thought that as we have support for defining cell styles in
sc/res/xml/styles.xml since the 2016 GSoC project, I would try that approach as
well (more human-readable and the expected place to look for it).

With the cell styles present in the source, in the exported ODS the styles.xml
will get

<style:style style:name="Default" style:family="table-cell">
    <style:text-properties fo:color="#000000" fo:font-size="10pt"
fo:font-style="normal" fo:font-weight="normal" />
</style:style>

These additional attributes for color, font-style and font-weight are added in
ScOrcusStyles::font::applyToItemSet in sc/source/filter/orcus/interface.cxx

When using the stlpool.cxx approach, the only attribute will be font-size. In
this case there are no test failures.

I would appreciate any tips in debugging what is going on in the ScDocShell.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20201228/cb6d48ab/attachment.htm>


More information about the Libreoffice-bugs mailing list