<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Unexpected content inserted into XML element in ScDocShell when adding Default style to sc/res/xml/styles.xml"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=139281">139281</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unexpected content inserted into XML element in ScDocShell when adding Default style to sc/res/xml/styles.xml
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Calc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ilmari.lauhakangas@libreoffice.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FILESAVE: ODS - Default cell style font size not set"
   href="show_bug.cgi?id=112559">bug 112559</a> "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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>