diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-04 12:56:46 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-05-04 18:16:46 +0200 |
commit | 0eac1549c9b6d84142238e62f629bd58321da727 (patch) | |
tree | 4b8017345560ba1ad63e4ce3a7dfd9cf38bd0e30 /sc | |
parent | 81ce88aa80f8e7cde4fdc5b211e9500a3599643c (diff) |
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>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/ods/tdf130108.ods | bin | 0 -> 10181 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf130108.ods b/sc/qa/unit/data/ods/tdf130108.ods Binary files differnew file mode 100644 index 000000000000..7cb563e2696d --- /dev/null +++ b/sc/qa/unit/data/ods/tdf130108.ods 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(); } |