summaryrefslogtreecommitdiff
path: root/sc/qa/unit/subsequent_export-test.cxx
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2020-10-13 15:48:31 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-19 10:42:53 +0200
commit699372466384113cf015be714e0067e857f8fa5c (patch)
treef984253d733c4406394df31609de441f6a7281b2 /sc/qa/unit/subsequent_export-test.cxx
parent1441ab9c75a2f0ac664983db22b681a1b602f8a9 (diff)
tdf#90104 XLSX export: fix commas in data validation list
Comma was exported as list separator instead of decimal separator, messing up the data validation list by breaking integer and fractional parts of a number to two integer numbers, for example the 2-item list 1,5, 2,5 to the bad 4-item list 1, 5, 2, 5. Note: for testing with numbers, it needs to set decimal separator to comma in locale settings. Co-authored-by: Attila Szűcs (NISZ) Change-Id: I6133c402b47aab8ed9f02b412762404fc520badc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104240 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/qa/unit/subsequent_export-test.cxx')
-rw-r--r--sc/qa/unit/subsequent_export-test.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index e928785d062e..bf015d93eac7 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -93,6 +93,7 @@ public:
ScDocShellRef saveAndReloadPassword( ScDocShell*, const OUString&, const OUString&, const OUString&, SfxFilterFlags );
void test();
+ void testTdf90104();
void testTdf111876();
void testPasswordExportODS();
void testTdf134332();
@@ -276,6 +277,7 @@ public:
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
+ CPPUNIT_TEST(testTdf90104);
CPPUNIT_TEST(testTdf111876);
CPPUNIT_TEST(testPasswordExportODS);
CPPUNIT_TEST(testTdf134332);
@@ -478,6 +480,7 @@ void ScExportTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
{ BAD_CAST("ContentType"), BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types") },
{ BAD_CAST("x14"), BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2009/9/main") },
{ BAD_CAST("xm"), BAD_CAST("http://schemas.microsoft.com/office/excel/2006/main") },
+ { BAD_CAST("x12ac"), BAD_CAST("http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac") },
};
for(size_t i = 0; i < SAL_N_ELEMENTS(aNamespaces); ++i)
{
@@ -541,6 +544,27 @@ void ScExportTest::test()
xDocSh->DoClose();
}
+void ScExportTest::testTdf90104()
+{
+ ScDocShellRef xShell = loadDoc("tdf90104.", FORMAT_XLSX);
+ CPPUNIT_ASSERT(xShell.is());
+
+ ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX);
+ CPPUNIT_ASSERT(xDocSh.is());
+
+ std::shared_ptr<utl::TempFile> pXPathFile
+ = ScBootstrapFixture::exportTo(&(*xDocSh), FORMAT_XLSX);
+
+ xmlDocUniquePtr pDoc
+ = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
+ CPPUNIT_ASSERT(pDoc);
+
+ assertXPathContent(pDoc, "/x:worksheet/x:dataValidations/x:dataValidation/mc:AlternateContent"
+ "/mc:Choice/x12ac:list", "1,\"2,3\",4,\"5,6\"");
+ assertXPathContent(pDoc, "/x:worksheet/x:dataValidations/x:dataValidation/mc:AlternateContent"
+ "/mc:Fallback/x:formula1", "\"1,2,3,4,5,6\"");
+}
+
void ScExportTest::testTdf111876()
{
// Document with relative path hyperlink