diff options
Diffstat (limited to 'i18npool/source/calendar/calendar_gregorian.cxx')
-rw-r--r-- | i18npool/source/calendar/calendar_gregorian.cxx | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx index 0ba91c0587d8..5cd86d7857db 100644 --- a/i18npool/source/calendar/calendar_gregorian.cxx +++ b/i18npool/source/calendar/calendar_gregorian.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -128,8 +129,9 @@ static void debug_i18n_cal_dump( const ::icu::Calendar & r ) using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::i18n; -using namespace ::rtl; +using ::rtl::OUString; + +namespace com { namespace sun { namespace star { namespace i18n { #define ERROR RuntimeException() @@ -170,17 +172,6 @@ Calendar_gregorian::init(Era *_eraArray) UErrorCode status; body = icu::Calendar::createInstance( aIcuLocale, status = U_ZERO_ERROR); if (!body || !U_SUCCESS(status)) throw ERROR; - -#if 0 - { - icu::Locale loc; - loc = body->getLocale( ULOC_ACTUAL_LOCALE, status = U_ZERO_ERROR); - fprintf( stderr, "\nICU calendar actual locale: %s\n", loc.getName()); - loc = body->getLocale( ULOC_VALID_LOCALE, status = U_ZERO_ERROR); - fprintf( stderr, "ICU calendar valid locale: %s\n", loc.getName()); - } -#endif - eraArray=_eraArray; } @@ -200,7 +191,7 @@ Calendar_hanja::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_Int16 if ( displayIndex == CalendarDisplayIndex::AM_PM ) { // Am/Pm string for Korean Hanja calendar will refer to Japanese locale com::sun::star::lang::Locale jaLocale = - com::sun::star::lang::Locale(OUString::createFromAscii("ja"), OUString(), OUString()); + com::sun::star::lang::Locale(OUString(RTL_CONSTASCII_USTRINGPARAM("ja")), OUString(), OUString()); if (idx == 0) return LocaleData().getLocaleItem(jaLocale).timeAM; else if (idx == 1) return LocaleData().getLocaleItem(jaLocale).timePM; else throw ERROR; @@ -214,7 +205,7 @@ Calendar_hanja::loadCalendar( const OUString& /*uniqueID*/, const com::sun::star { // 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(OUString::createFromAscii("hanja"), rLocale); + Calendar_gregorian::loadCalendar(OUString(RTL_CONSTASCII_USTRINGPARAM("hanja")), rLocale); } static Era gengou_eraArray[] = { @@ -805,9 +796,9 @@ static sal_Int16 SAL_CALL NatNumForCalendar(const com::sun::star::lang::Locale& nCalendarDisplayCode == CalendarDisplayCode::LONG_YEAR) && value >= 100) || nCalendarDisplayCode == CalendarDisplayCode::SHORT_QUARTER || nCalendarDisplayCode == CalendarDisplayCode::LONG_QUARTER; - sal_Bool isChinese = aLocale.Language.equalsAscii("zh"); - sal_Bool isJapanese = aLocale.Language.equalsAscii("ja"); - sal_Bool isKorean = aLocale.Language.equalsAscii("ko"); + sal_Bool isChinese = aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh")); + sal_Bool isJapanese = aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ja")); + sal_Bool isKorean = aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ko")); if (isChinese || isJapanese || isKorean) { switch (nNativeNumberMode) { @@ -993,7 +984,7 @@ Calendar_gregorian::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 sprintf(aStr, "%d", value); // #100211# - checked break; case CalendarDisplayCode::LONG_YEAR: - if (aCalendar.Name.equalsAscii("gengou")) + if (aCalendar.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("gengou"))) sprintf(aStr, "%02d", value); // #100211# - checked else sprintf(aStr, "%d", value); // #100211# - checked @@ -1098,3 +1089,6 @@ Calendar_gregorian::getSupportedServiceNames(void) throw( RuntimeException ) return aRet; } +}}}} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |