summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-11-19 15:51:41 +0100
committerEike Rathke <erack@redhat.com>2011-11-19 16:15:22 +0100
commit4b030331f725c63bc5ef0f365091179f0e6a78e5 (patch)
treeb1ab159eb97161cab005297e8ef261bd20594c61 /unotools
parent769511019bd5a02a5a2c307c2c8558279742672c (diff)
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.
Diffstat (limited to 'unotools')
-rw-r--r--unotools/inc/unotools/calendarwrapper.hxx6
-rw-r--r--unotools/inc/unotools/localedatawrapper.hxx4
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx18
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx4
4 files changed, 16 insertions, 16 deletions
diff --git a/unotools/inc/unotools/calendarwrapper.hxx b/unotools/inc/unotools/calendarwrapper.hxx
index e2785399e3cb..cc67696d0439 100644
--- a/unotools/inc/unotools/calendarwrapper.hxx
+++ b/unotools/inc/unotools/calendarwrapper.hxx
@@ -91,8 +91,6 @@ public:
void setMinimumNumberOfDaysForFirstWeek( sal_Int16 nDays );
sal_Int16 getNumberOfMonthsInYear() const;
sal_Int16 getNumberOfDaysInWeek() const;
- ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getMonths() const;
- ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getDays() const;
String getDisplayName( sal_Int16 nCalendarDisplayIndex, sal_Int16 nIdx, sal_Int16 nNameType ) const;
/** Convenience method to get timezone offset in milliseconds, taking both
@@ -110,8 +108,10 @@ public:
// wrapper implementations of XCalendar3
- ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getGenitiveMonths() const;
::com::sun::star::i18n::Calendar2 getLoadedCalendar() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDays() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getMonths() const;
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getGenitiveMonths() const;
// convenience methods
diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx
index 8564bfacfac4..0bfaa9768fe0 100644
--- a/unotools/inc/unotools/localedatawrapper.hxx
+++ b/unotools/inc/unotools/localedatawrapper.hxx
@@ -183,10 +183,10 @@ public:
const ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > getDefaultCalendar() const;
/// Convenience method to obtain the day names of the default calendar.
- const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getDefaultCalendarDays() const;
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDefaultCalendarDays() const;
/// Convenience method to obtain the month names of the default calendar.
- const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > getDefaultCalendarMonths() const;
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > getDefaultCalendarMonths() const;
/** Obtain digit grouping. The usually known grouping by thousands (#,###)
is actually only one of possible groupings. Another one, for example,
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index 5b7f4155eb58..6d7aa4bea94e 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -503,12 +503,12 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
}
-::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > CalendarWrapper::getMonths() const
+::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > CalendarWrapper::getMonths() const
{
try
{
if ( xC.is() )
- return xC->getMonths();
+ return xC->getMonths2();
}
catch ( Exception& e )
{
@@ -520,16 +520,16 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
(void)e;
#endif
}
- return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > (0);
+ return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > (0);
}
-::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > CalendarWrapper::getDays() const
+::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > CalendarWrapper::getDays() const
{
try
{
if ( xC.is() )
- return xC->getDays();
+ return xC->getDays2();
}
catch ( Exception& e )
{
@@ -541,7 +541,7 @@ sal_Int16 CalendarWrapper::getNumberOfDaysInWeek() const
(void)e;
#endif
}
- return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > (0);
+ return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > (0);
}
@@ -612,12 +612,12 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
}
-::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > CalendarWrapper::getGenitiveMonths() const
+::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > CalendarWrapper::getGenitiveMonths() const
{
try
{
if ( xC.is() )
- return xC->getGenitiveMonths();
+ return xC->getGenitiveMonths2();
}
catch ( Exception& e )
{
@@ -629,7 +629,7 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
(void)e;
#endif
}
- return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > (0);
+ return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > (0);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 81960aafff24..ee893b2d65d1 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -614,13 +614,13 @@ const ::boost::shared_ptr< ::com::sun::star::i18n::Calendar2 > LocaleDataWrapper
}
-const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > LocaleDataWrapper::getDefaultCalendarDays() const
+const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > LocaleDataWrapper::getDefaultCalendarDays() const
{
return getDefaultCalendar()->Days;
}
-const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > LocaleDataWrapper::getDefaultCalendarMonths() const
+const ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > LocaleDataWrapper::getDefaultCalendarMonths() const
{
return getDefaultCalendar()->Months;
}