summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/qa/unit/data/xlsx/preserve-whitespace.xlsxbin0 -> 10859 bytes
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx16
2 files changed, 15 insertions, 1 deletions
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 000000000000..c9f97942d984
--- /dev/null
+++ b/sc/qa/unit/data/xlsx/preserve-whitespace.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index dc1e93ef892e..fe1e8597ec8e 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);