summaryrefslogtreecommitdiff
path: root/i18npool/source/calendar/calendar_gregorian.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/calendar/calendar_gregorian.cxx')
-rw-r--r--i18npool/source/calendar/calendar_gregorian.cxx23
1 files changed, 18 insertions, 5 deletions
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index 3aa516814538..69fb08797ab3 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -201,14 +201,27 @@ Calendar_hanja::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16
return Calendar_gregorian::getDisplayName( displayIndex, idx, nameType );
}
-void SAL_CALL
-Calendar_hanja::loadCalendar( const OUString& /*uniqueID*/, const css::lang::Locale& rLocale )
+
+Calendar_hanja_yoil::Calendar_hanja_yoil()
+{
+ cCalendar = "com.sun.star.i18n.Calendar_Calendar_hanja_yoil";
+}
+
+OUString SAL_CALL
+Calendar_hanja_yoil::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 nameType )
{
- // Since this class could be called by service name 'hanja_yoil', we have to
- // rename uniqueID to get right calendar defined in locale data.
- Calendar_gregorian::loadCalendar("hanja", rLocale);
+ if ( displayIndex == CalendarDisplayIndex::AM_PM ) {
+ // Am/Pm string for Korean Hanja calendar will refer to Japanese locale
+ css::lang::Locale jaLocale("ja", OUString(), OUString());
+ if (idx == 0) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timeAM;
+ else if (idx == 1) return LocaleDataImpl::get()->getLocaleItem(jaLocale).timePM;
+ else throw ERROR;
+ }
+ else
+ return Calendar_gregorian::getDisplayName( displayIndex, idx, nameType );
}
+
const Era gengou_eraArray[] = {
{1868, 1, 1, 0}, // Meiji
{1912, 7, 30, 0}, // Taisho