diff options
-rw-r--r-- | svl/qa/unit/svl.cxx | 21 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 3 |
2 files changed, 24 insertions, 0 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 9ae468f00c83..48b5b4433a58 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -60,6 +60,7 @@ public: void testSharedStringPoolPurge(); void testFdo60915(); void testI116701(); + void testTdf103060(); void testDateInput(); void testIsNumberFormat(); void testUserDefinedNumberFormats(); @@ -71,6 +72,7 @@ public: CPPUNIT_TEST(testSharedStringPoolPurge); CPPUNIT_TEST(testFdo60915); CPPUNIT_TEST(testI116701); + CPPUNIT_TEST(testTdf103060); CPPUNIT_TEST(testDateInput); CPPUNIT_TEST(testIsNumberFormat); CPPUNIT_TEST(testUserDefinedNumberFormats); @@ -484,6 +486,25 @@ void Test::testI116701() checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); } +void Test::testTdf103060() +{ + LanguageType eLang = LANGUAGE_JAPANESE; + OUString sCode, sExpected; + double fPreviewNumber = 42655; // equals 2016-10-12 + SvNumberFormatter aFormatter(m_xContext, eLang); + sCode = "G"; + sExpected = "H"; // Heisei era + checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); + sCode = "GG"; + const sal_Unicode EXPECTED_G2[] = {0x5E73}; + sExpected = OUString(EXPECTED_G2, SAL_N_ELEMENTS(EXPECTED_G2)); + checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); + sCode = "GGG"; + const sal_Unicode EXPECTED_G3[] = {0x5E73, 0x6210}; + sExpected = OUString(EXPECTED_G3, SAL_N_ELEMENTS(EXPECTED_G3)); + checkPreviewString(aFormatter, sCode, fPreviewNumber, eLang, sExpected); +} + void Test::testDateInput() { const char* aData[][2] = { diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index a37987ebdbcc..8178b7e4e385 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -3264,6 +3264,9 @@ bool SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const case NF_KEY_RR : case NF_KEY_AAA : case NF_KEY_AAAA : + case NF_KEY_G : + case NF_KEY_GG : + case NF_KEY_GGG : return true; } } |