[Libreoffice-commits] core.git: sc/qa
Laurent Balland-Poirier
laurent.balland-poirier at laposte.net
Tue Aug 23 13:49:17 UTC 2016
sc/qa/unit/data/ods/tdf79398_NatNum5.ods |binary
sc/qa/unit/subsequent_export-test.cxx | 17 +++++++++++++++++
2 files changed, 17 insertions(+)
New commits:
commit d7ce684cae03e97b23f916a90db55e49f17a1601
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date: Sat Aug 13 10:46:06 2016 +0200
tdf#79398 Add qa unit test
Native number format [NatNum5] in Chinese is exported to [DBNum2] in XLSX
with [$-804] to force Chinese language
Change-Id: I271772515558d0b080abf2435642e578ea63f392
Reviewed-on: https://gerrit.libreoffice.org/28097
Reviewed-by: Eike Rathke <erack at redhat.com>
Tested-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/qa/unit/data/ods/tdf79398_NatNum5.ods b/sc/qa/unit/data/ods/tdf79398_NatNum5.ods
new file mode 100644
index 0000000..08f2028
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf79398_NatNum5.ods differ
diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 848fbb8..18deabd 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -172,6 +172,7 @@ public:
void testTdf88657();
void testEscapeCharInNumberFormatXLSX();
+ void testNatNumInNumberFormatXLSX();
CPPUNIT_TEST_SUITE(ScExportTest);
CPPUNIT_TEST(test);
@@ -252,6 +253,7 @@ public:
CPPUNIT_TEST(testTdf88657);
CPPUNIT_TEST(testEscapeCharInNumberFormatXLSX);
+ CPPUNIT_TEST(testNatNumInNumberFormatXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -3638,6 +3640,21 @@ void ScExportTest::testEscapeCharInNumberFormatXLSX()
xDocSh->DoClose();
}
+void ScExportTest::testNatNumInNumberFormatXLSX()
+{
+ ScDocShellRef xDocSh = loadDoc("tdf79398_NatNum5.", FORMAT_ODS);
+ CPPUNIT_ASSERT( xDocSh.Is() );
+ xDocSh = saveAndReload( &(*xDocSh), FORMAT_XLSX); // Convert [NatNum5] to [DBNum2] in Chinese
+ CPPUNIT_ASSERT( xDocSh.Is() );
+
+ xmlDocPtr pDoc = XPathHelper::parseExport(*xDocSh, m_xSFactory, "xl/styles.xml", FORMAT_XLSX);
+ CPPUNIT_ASSERT(pDoc);
+
+ assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]", "formatCode", "[DBNum2][$-804]General");
+
+ xDocSh->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(ScExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
More information about the Libreoffice-commits
mailing list