diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-21 17:29:01 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-22 08:07:35 +0200 |
commit | f308520f1e3624c88e2a0e99be2eb26e2f2d0fc4 (patch) | |
tree | 041919d759513762761164bfad8239e9f6c10894 | |
parent | 0e66c58a8e20b997097d8b8644e774701c2d68b6 (diff) |
tdf#133771: sw_ooxmlexport14: Add unittest
Change-Id: Ie2b6ad6dd0b537d59ccd5edb5d699a2b3bbd82ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104636
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf133771.odt | bin | 0 -> 12738 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 22 |
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf133771.odt b/sw/qa/extras/ooxmlexport/data/tdf133771.odt Binary files differnew file mode 100644 index 000000000000..fd54160af9d1 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf133771.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 224a79eb3c32..3ac228db6cca 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -736,6 +736,28 @@ CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTableStyleConfNested) assertXPath(pXmlDoc, "//w:body/w:tbl/w:tr/w:tc[2]/w:tcPr/w:tcBorders/w:top", "val", "nil"); } +CPPUNIT_TEST_FIXTURE(SwModelTestBase, testTdf133771) +{ + // Create the doc model. + OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf133771.odt"; + loadURL(aURL, nullptr, /*pPassword*/ "test"); + + CPPUNIT_ASSERT_EQUAL(OUString("Password Protected"), getParagraph(1)->getString()); + + // Without the fix in place, this test would have failed with + // "An uncaught exception of type com.sun.star.io.IOException" + // exporting to docx + uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); + utl::MediaDescriptor aMediaDescriptor; + aMediaDescriptor["FilterName"] <<= OUString("Office Open XML Text"); + xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); + validate(maTempFile.GetFileName(), test::OOXML); + mbExported = true; + xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml"); + CPPUNIT_ASSERT(pXmlDoc); + assertXPathContent(pXmlDoc, "//w:body/w:p/w:r/w:t", "Password Protected"); +} + CPPUNIT_TEST_FIXTURE(SwModelTestBase, testZeroLineSpacing) { // Create the doc model. |