summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-18 03:55:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-19 22:31:25 +0200
commit3b0aae379e77dade4bde1f832225728ce6214816 (patch)
treef12785ea6b51447f049f036a73442534188b6a2b
parentbe4e1141be7cd54cf5362d3de534050db5505437 (diff)
add unit test for tdf#88137, tdf#89254
Conflicts: sc/qa/unit/subsequent_export-test.cxx Change-Id: Ibf7e46cfecf5e8d54450feac481edb2c699408cc
-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);