From 0eac1549c9b6d84142238e62f629bd58321da727 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 4 May 2020 12:56:46 +0200 Subject: related: tdf#130108: sc: Add unittest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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Ă­ --- sc/qa/unit/data/ods/tdf130108.ods | Bin 0 -> 10181 bytes sc/qa/unit/subsequent_export-test.cxx | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 sc/qa/unit/data/ods/tdf130108.ods (limited to 'sc') diff --git a/sc/qa/unit/data/ods/tdf130108.ods b/sc/qa/unit/data/ods/tdf130108.ods new file mode 100644 index 000000000000..7cb563e2696d Binary files /dev/null and b/sc/qa/unit/data/ods/tdf130108.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index de4344afbb2f..260a353884d1 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(); } -- cgit