svl/qa/unit/svl.cxx | 21 +++++++++++++++++++++ svl/source/numbers/zformat.cxx | 3 +++ 2 files changed, 24 insertions(+)
New commits: commit 1bd2f008130c717f8f2acd6edad64e00faa2e98d Author: Takeshi Abe <t...@fixedpoint.jp> Date: Fri Oct 21 11:46:47 2016 +0900 tdf#103060 Format "GGG" as the era name of a locale-dependent calendar by default, as Excel does. This change applies to "GG" and "G" as well. Note that nothing changes for Italian locale, in which "GGG" stays as a placeholder for day of week. Change-Id: Iad68f6a9548b7229930c0e0c518fdb29bfaa026f Reviewed-on: https://gerrit.libreoffice.org/29724 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Eike Rathke <er...@redhat.com> diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 9ae468f..48b5b44 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 a37987e..8178b7e 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; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits