summaryrefslogtreecommitdiff
path: root/svl
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 /svl
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 'svl')
-rw-r--r--svl/source/numbers/zforfind.cxx2
-rw-r--r--svl/source/numbers/zformat.cxx8
2 files changed, 7 insertions, 3 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index a4086335562b..bb249be090a4 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -2431,7 +2431,7 @@ void ImpSvNumberInputScan::InitText()
delete [] pUpperMonthText;
delete [] pUpperAbbrevMonthText;
- ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem > xElems
+ ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::CalendarItem2 > xElems
= pCal->getMonths();
nElems = xElems.getLength();
pUpperMonthText = new String[nElems];
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index e6da6105f25e..a56abdc3b0dd 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3194,7 +3194,9 @@ bool SvNumberformat::ImpGetDateOutput(double fNumber,
break;
case NF_KEY_MMMMM: // MMMMM
OutString += rCal.getDisplayString(
- CalendarDisplayCode::LONG_MONTH_NAME, nNatNum ).GetChar(0);
+ (ImpUseGenitiveMonth( nUseGenitiveMonth, NumFor[nIx]) ?
+ CalendarDisplayCode::NARROW_GENITIVE_MONTH_NAME :
+ CalendarDisplayCode::NARROW_MONTH_NAME), nNatNum );
break;
case NF_KEY_Q: // Q
OutString += rCal.getDisplayString(
@@ -3521,7 +3523,9 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
break;
case NF_KEY_MMMMM: // MMMMM
OutString += rCal.getDisplayString(
- CalendarDisplayCode::LONG_MONTH_NAME, nNatNum ).GetChar(0);
+ (ImpUseGenitiveMonth( nUseGenitiveMonth, NumFor[nIx]) ?
+ CalendarDisplayCode::NARROW_GENITIVE_MONTH_NAME :
+ CalendarDisplayCode::NARROW_MONTH_NAME), nNatNum );
break;
case NF_KEY_Q: // Q
OutString += rCal.getDisplayString(