sc/qa/unit/data/xlsx/preserve-whitespace.xlsx |binary sc/qa/unit/subsequent_export-test.cxx | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-)
New commits: commit 3b0aae379e77dade4bde1f832225728ce6214816 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sat Apr 18 03:55:48 2015 +0200 add unit test for tdf#88137, tdf#89254 Conflicts: sc/qa/unit/subsequent_export-test.cxx Change-Id: Ibf7e46cfecf5e8d54450feac481edb2c699408cc diff --git a/sc/qa/unit/data/xlsx/preserve-whitespace.xlsx b/sc/qa/unit/data/xlsx/preserve-whitespace.xlsx new file mode 100644 index 0000000..c9f9794 Binary files /dev/null and b/sc/qa/unit/data/xlsx/preserve-whitespace.xlsx differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index dc1e93e..fe1e859 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -153,7 +153,7 @@ public: void testHyperlinkXLSX(); void testMoveCellAnchoredShapes(); void testMatrixMultiplication(); - + void testPreserveTextWhitespaceXLSX(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -203,6 +203,7 @@ public: CPPUNIT_TEST(testSwappedOutImageExport); CPPUNIT_TEST(testLinkedGraphicRT); CPPUNIT_TEST(testImageWithSpecialID); + CPPUNIT_TEST(testPreserveTextWhitespaceXLSX); CPPUNIT_TEST(testSheetLocalRangeNameXLS); CPPUNIT_TEST(testSheetTextBoxHyperlink); CPPUNIT_TEST(testFontSize); @@ -230,6 +231,7 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) struct { xmlChar* pPrefix; xmlChar* pURI; } aNamespaces[] = { { BAD_CAST("w"), BAD_CAST("http://schemas.openxmlformats.org/wordprocessingml/2006/main") }, + { BAD_CAST("x"), BAD_CAST("http://schemas.openxmlformats.org/spreadsheetml/2006/main") }, { BAD_CAST("v"), BAD_CAST("urn:schemas-microsoft-com:vml") }, { BAD_CAST("c"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/chart") }, { BAD_CAST("a"), BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/main") }, @@ -2679,6 +2681,18 @@ void ScExportTest::testSheetRunParagraphProperty() xDocSh->DoClose(); } +void ScExportTest::testPreserveTextWhitespaceXLSX() +{ + ScDocShellRef xShell = loadDoc("preserve-whitespace.", XLSX); + ScDocShellRef xDocSh = saveAndReload(&(*xShell), XLSX); + CPPUNIT_ASSERT(xDocSh.Is()); + + xmlDocPtr pDoc = XPathHelper::parseExport(&(*xDocSh), m_xSFactory, "xl/sharedStrings.xml", XLSX); + CPPUNIT_ASSERT(pDoc); + assertXPath(pDoc, "/x:sst/x:si/x:t", "space", "preserve"); + xDocSh->DoClose(); +} + void ScExportTest::testHiddenShape() { ScDocShellRef xDocSh = loadDoc("hiddenShape.", XLSX); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits