diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2016-08-13 10:46:06 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-08-23 13:48:51 +0000 |
commit | d7ce684cae03e97b23f916a90db55e49f17a1601 (patch) | |
tree | b51e81170288e1e00a09bf0c8345fd2974f2c928 /sc | |
parent | 4ccd991f6a6ca680ac2b7513ab3853e1ba9c71a3 (diff) |
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@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/data/ods/tdf79398_NatNum5.ods | bin | 0 -> 7420 bytes | |||
-rw-r--r-- | sc/qa/unit/subsequent_export-test.cxx | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sc/qa/unit/data/ods/tdf79398_NatNum5.ods b/sc/qa/unit/data/ods/tdf79398_NatNum5.ods Binary files differnew file mode 100644 index 000000000000..08f2028e8c6e --- /dev/null +++ b/sc/qa/unit/data/ods/tdf79398_NatNum5.ods diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 848fbb8c8c2c..18deabd1969d 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(); |