From 4b030331f725c63bc5ef0f365091179f0e6a78e5 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Sat, 19 Nov 2011 15:51:41 +0100 Subject: add narrow (one letter) month names While introducing Calendar2 and the XCalendar3 interface anyway, as well the "one letter" narrow month names sometimes needed in calendaring can be added. These are not always the first capitalized letters of the months in all locales, and might even not necessarily be just one character. Introduces a new struct css::i18n::Calendar2 that is not derived from css::i18n::Calendar because it uses a new struct css::i18n::CalendarItem2 to hold the NarrowName elements. In locale data the elements DaysOfMonth, MonthsOfYear and GenitiveMonths now have an optional element DefaultNarrowName. If not specified, the first character of DefaultFullName is taken. LocaleDataWrapper and CalendarWrapper use and return the new Calendar2 and sequences of CalendarItem2 structs. Application code adapted. The number formatter now displays narrow month names (genitive if applicable) for the MMMMM code, previously it displayed the first 16 bit code point of the full name (not even utf-16 aware). Narrow day names currently are not used, except in svtools' Calendar control. --- i18npool/source/calendar/calendarImpl.cxx | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'i18npool/source/calendar/calendarImpl.cxx') diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index 52eea4ff0a44..aebc1d5accdc 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -292,11 +292,31 @@ CalendarImpl::getMonths() throw(RuntimeException) } -Sequence< CalendarItem > SAL_CALL -CalendarImpl::getGenitiveMonths() throw(RuntimeException) +Sequence< CalendarItem2 > SAL_CALL +CalendarImpl::getDays2() throw(RuntimeException) +{ + if (xCalendar.is()) + return xCalendar->getDays2(); + else + throw ERROR ; +} + + +Sequence< CalendarItem2 > SAL_CALL +CalendarImpl::getMonths2() throw(RuntimeException) +{ + if (xCalendar.is()) + return xCalendar->getMonths2(); + else + throw ERROR ; +} + + +Sequence< CalendarItem2 > SAL_CALL +CalendarImpl::getGenitiveMonths2() throw(RuntimeException) { if (xCalendar.is()) - return xCalendar->getGenitiveMonths(); + return xCalendar->getGenitiveMonths2(); else throw ERROR ; } -- cgit v1.2.3