related: tdf#130108: sc: Add unittest

The issue per se can't be tested in ScExportTest
because it's not happening when using the commandline, but the gui.
See: https://bugs.documentfoundation.org/show_bug.cgi?id=130108#c13
Still, there is no existing test for x:dxfs elements so I think
this test is still useful

Change-Id: I5fc650aedfa06416732941367b31cc18199e2cc3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93411
Tested-by: Jenkins
Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
diff --git a/sc/qa/unit/data/ods/tdf130108.ods b/sc/qa/unit/data/ods/tdf130108.ods
new file mode 100644
index 0000000..7cb563e
--- /dev/null
+++ b/sc/qa/unit/data/ods/tdf130108.ods
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index de4344a..260a353 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -195,6 +195,7 @@ public:
    void testPreserveTextWhitespace2XLSX();
    void testTextDirectionXLSX();
    void testTdf66668();
    void testTdf130108();
    void testTdf55417();
    void testTdf129985();
    void testTdf73063();
@@ -338,6 +339,7 @@ public:
    CPPUNIT_TEST(testMatrixMultiplicationXLSX);
    CPPUNIT_TEST(testTextDirectionXLSX);
    CPPUNIT_TEST(testTdf66668);
    CPPUNIT_TEST(testTdf130108);
    CPPUNIT_TEST(testTdf55417);
    CPPUNIT_TEST(testTdf129985);
    CPPUNIT_TEST(testTdf73063);
@@ -4030,6 +4032,22 @@ void ScExportTest::testTdf66668()

    xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/styles.xml", FORMAT_XLSX);
    CPPUNIT_ASSERT(pDoc);
    xDocSh->DoClose();
}

void ScExportTest::testTdf130108()
{
    ScDocShellRef xDocSh = loadDoc("tdf130108.", FORMAT_ODS);
    CPPUNIT_ASSERT(xDocSh.is());

    xmlDocPtr pDoc = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/styles.xml", FORMAT_XLSX);
    CPPUNIT_ASSERT(pDoc);

    assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:b", "val", "1");
    assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:i", "val", "0");
    assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:color", "rgb", "FFFFFFFF");
    assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:font/x:sz", "val", "10");
    assertXPath(pDoc, "/x:styleSheet/x:dxfs/x:dxf/x:fill/x:patternFill/x:bgColor", "rgb", "FFCC0000");

    xDocSh->DoClose();
}