Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a7dbdbf8
Kaydet (Commit)
a7dbdbf8
authored
Kas 18, 2011
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement possessive genitive case month names locale data API
üst
19f607d7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
117 additions
and
33 deletions
+117
-33
calendarImpl.hxx
i18npool/inc/calendarImpl.hxx
+9
-5
calendar_gregorian.hxx
i18npool/inc/calendar_gregorian.hxx
+5
-1
localedata.hxx
i18npool/inc/localedata.hxx
+6
-5
calendarImpl.cxx
i18npool/source/calendar/calendarImpl.cxx
+26
-7
calendar_gregorian.cxx
i18npool/source/calendar/calendar_gregorian.cxx
+30
-3
localedata.cxx
i18npool/source/localedata/localedata.cxx
+41
-12
No files found.
i18npool/inc/calendarImpl.hxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -28,7 +28,7 @@
#ifndef _I18N_CALENDARIMPL_HXX_
#define _I18N_CALENDARIMPL_HXX_
#include <com/sun/star/i18n/X
ExtendedCalendar
.hpp>
#include <com/sun/star/i18n/X
Calendar3
.hpp>
#include <com/sun/star/i18n/CalendarDisplayCode.hpp>
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include <com/sun/star/i18n/CalendarDisplayIndex.hpp>
...
...
@@ -44,7 +44,7 @@ namespace com { namespace sun { namespace star { namespace i18n {
class
CalendarImpl
:
public
cppu
::
WeakImplHelper2
<
com
::
sun
::
star
::
i18n
::
X
ExtendedCalendar
,
com
::
sun
::
star
::
i18n
::
X
Calendar3
,
com
::
sun
::
star
::
lang
::
XServiceInfo
>
{
...
...
@@ -85,6 +85,10 @@ public:
// Methods in XExtendedCalendar
virtual
rtl
::
OUString
SAL_CALL
getDisplayString
(
sal_Int32
nCalendarDisplayCode
,
sal_Int16
nNativeNumberMode
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XCalendar3
virtual
Calendar2
SAL_CALL
getLoadedCalendar2
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
CalendarItem
>
SAL_CALL
getGenitiveMonths
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
//XServiceInfo
virtual
rtl
::
OUString
SAL_CALL
getImplementationName
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
sal_Bool
SAL_CALL
supportsService
(
const
rtl
::
OUString
&
ServiceName
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
@@ -92,14 +96,14 @@ public:
private
:
struct
lookupTableItem
{
lookupTableItem
(
const
rtl
::
OUString
&
_uniqueID
,
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
ExtendedCalendar
>&
_xCalendar
)
:
lookupTableItem
(
const
rtl
::
OUString
&
_uniqueID
,
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
Calendar3
>&
_xCalendar
)
:
uniqueID
(
_uniqueID
),
xCalendar
(
_xCalendar
)
{}
rtl
::
OUString
uniqueID
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
ExtendedCalendar
>
xCalendar
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
Calendar3
>
xCalendar
;
};
std
::
vector
<
lookupTableItem
*>
lookupTable
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XMultiServiceFactory
>
xMSF
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
ExtendedCalendar
>
xCalendar
;
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
i18n
::
X
Calendar3
>
xCalendar
;
};
}
}
}
}
...
...
i18npool/inc/calendar_gregorian.hxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -84,6 +84,10 @@ public:
// Methods in XExtendedCalendar
virtual
rtl
::
OUString
SAL_CALL
getDisplayString
(
sal_Int32
nCalendarDisplayCode
,
sal_Int16
nNativeNumberMode
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
// XCalendar3
virtual
Calendar2
SAL_CALL
getLoadedCalendar2
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
CalendarItem
>
SAL_CALL
getGenitiveMonths
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
//XServiceInfo
virtual
rtl
::
OUString
SAL_CALL
getImplementationName
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
sal_Bool
SAL_CALL
supportsService
(
const
rtl
::
OUString
&
ServiceName
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
@@ -104,7 +108,7 @@ protected:
void
getValue
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
private
:
Calendar
aCalendar
;
Calendar
2
aCalendar
;
/** Submit fieldSetValue array according to fieldSet. */
void
submitFields
()
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
i18npool/inc/localedata.hxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -32,7 +32,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/i18n/XLocaleData
2
.hpp>
#include <com/sun/star/i18n/XLocaleData
3
.hpp>
#include <cppuhelper/implbase2.hxx> // helper for implementations
...
...
@@ -74,7 +74,7 @@ inline sal_Bool operator ==(const com::sun::star::lang::Locale& l1, const com::s
class
LocaleData
:
public
cppu
::
WeakImplHelper2
<
XLocaleData
2
,
XLocaleData
3
,
com
::
sun
::
star
::
lang
::
XServiceInfo
>
{
...
...
@@ -84,6 +84,7 @@ public:
virtual
LanguageCountryInfo
SAL_CALL
getLanguageCountryInfo
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
LocaleDataItem
SAL_CALL
getLocaleItem
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
Calendar2
>
SAL_CALL
getAllCalendars2
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
Calendar
>
SAL_CALL
getAllCalendars
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
Currency
>
SAL_CALL
getAllCurrencies
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
com
::
sun
::
star
::
uno
::
Sequence
<
Currency2
>
SAL_CALL
getAllCurrencies2
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
...
...
@@ -126,12 +127,12 @@ private :
oslGenericFunction
SAL_CALL
getFunctionSymbolByName
(
const
rtl
::
OUString
&
localeName
,
const
sal_Char
*
pFunction
);
sal_Unicode
**
SAL_CALL
getIndexArray
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
,
sal_Int16
&
indexCount
);
sal_Unicode
**
SAL_CALL
getIndexArrayForAlgorithm
(
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
,
const
rtl
::
OUString
&
rAlgorithm
);
com
::
sun
::
star
::
i18n
::
Calendar
ref_cal
;
com
::
sun
::
star
::
i18n
::
Calendar
2
ref_cal
;
rtl
::
OUString
ref_name
;
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
i18n
::
CalendarItem
>
&
getCalendarItemByName
(
const
rtl
::
OUString
&
name
,
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
,
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
i18n
::
Calendar
>&
calendarsSeq
,
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
i18n
::
Calendar
2
>&
calendarsSeq
,
sal_Int16
item
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
/// Helper to obtain a sequence of days, months, gmonths or eras.
...
...
@@ -141,7 +142,7 @@ private :
const
sal_Int16
nWhichItem
,
const
sal_Int16
nCalendar
,
const
com
::
sun
::
star
::
lang
::
Locale
&
rLocale
,
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
i18n
::
Calendar
>
&
calendarsSeq
)
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
i18n
::
Calendar
2
>
&
calendarsSeq
)
throw
(
com
::
sun
::
star
::
uno
::
RuntimeException
);
};
...
...
i18npool/source/calendar/calendarImpl.cxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -57,7 +57,7 @@ CalendarImpl::~CalendarImpl()
void
SAL_CALL
CalendarImpl
::
loadDefaultCalendar
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
Sequence
<
Calendar
>
xC
=
LocaleData
().
getAllCalendars
(
rLocale
);
Sequence
<
Calendar
2
>
xC
=
LocaleData
().
getAllCalendars2
(
rLocale
);
for
(
sal_Int32
i
=
0
;
i
<
xC
.
getLength
();
i
++
)
{
if
(
xC
[
i
].
Default
)
{
loadCalendar
(
xC
[
i
].
Name
,
rLocale
);
...
...
@@ -70,7 +70,7 @@ CalendarImpl::loadDefaultCalendar( const Locale& rLocale ) throw(RuntimeExceptio
void
SAL_CALL
CalendarImpl
::
loadCalendar
(
const
OUString
&
uniqueID
,
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
Reference
<
X
ExtendedCalendar
>
xOldCalendar
(
xCalendar
);
// backup
Reference
<
X
Calendar3
>
xOldCalendar
(
xCalendar
);
// backup
sal_Int32
i
;
for
(
i
=
0
;
i
<
sal
::
static_int_cast
<
sal_Int32
>
(
lookupTable
.
size
());
i
++
)
{
...
...
@@ -87,7 +87,7 @@ CalendarImpl::loadCalendar(const OUString& uniqueID, const Locale& rLocale ) thr
if
(
!
xI
.
is
()
)
{
// check if the calendar is defined in localedata, load gregorian calendar service.
Sequence
<
Calendar
>
xC
=
LocaleData
().
getAllCalendars
(
rLocale
);
Sequence
<
Calendar
2
>
xC
=
LocaleData
().
getAllCalendars2
(
rLocale
);
for
(
i
=
0
;
i
<
xC
.
getLength
();
i
++
)
{
if
(
uniqueID
==
xC
[
i
].
Name
)
{
xI
=
xMSF
->
createInstance
(
...
...
@@ -98,7 +98,7 @@ CalendarImpl::loadCalendar(const OUString& uniqueID, const Locale& rLocale ) thr
}
if
(
xI
.
is
()
)
xI
->
queryInterface
(
::
getCppuType
((
const
Reference
<
X
ExtendedCalendar
>*
)
0
))
>>=
xCalendar
;
xI
->
queryInterface
(
::
getCppuType
((
const
Reference
<
X
Calendar3
>*
)
0
))
>>=
xCalendar
;
else
throw
ERROR
;
...
...
@@ -122,6 +122,15 @@ CalendarImpl::loadCalendar(const OUString& uniqueID, const Locale& rLocale ) thr
}
}
Calendar2
SAL_CALL
CalendarImpl
::
getLoadedCalendar2
()
throw
(
RuntimeException
)
{
if
(
xCalendar
.
is
())
return
xCalendar
->
getLoadedCalendar2
();
else
throw
ERROR
;
}
Calendar
SAL_CALL
CalendarImpl
::
getLoadedCalendar
()
throw
(
RuntimeException
)
{
...
...
@@ -134,7 +143,7 @@ CalendarImpl::getLoadedCalendar() throw(RuntimeException)
Sequence
<
OUString
>
SAL_CALL
CalendarImpl
::
getAllCalendars
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
Sequence
<
Calendar
>
xC
=
LocaleData
().
getAllCalendars
(
rLocale
);
Sequence
<
Calendar
2
>
xC
=
LocaleData
().
getAllCalendars2
(
rLocale
);
sal_Int32
nLen
=
xC
.
getLength
();
Sequence
<
OUString
>
xSeq
(
nLen
);
for
(
sal_Int32
i
=
0
;
i
<
nLen
;
i
++
)
...
...
@@ -263,6 +272,16 @@ CalendarImpl::getNumberOfDaysInWeek() throw(RuntimeException)
}
Sequence
<
CalendarItem
>
SAL_CALL
CalendarImpl
::
getDays
()
throw
(
RuntimeException
)
{
if
(
xCalendar
.
is
())
return
xCalendar
->
getDays
();
else
throw
ERROR
;
}
Sequence
<
CalendarItem
>
SAL_CALL
CalendarImpl
::
getMonths
()
throw
(
RuntimeException
)
{
...
...
@@ -274,10 +293,10 @@ CalendarImpl::getMonths() throw(RuntimeException)
Sequence
<
CalendarItem
>
SAL_CALL
CalendarImpl
::
get
Day
s
()
throw
(
RuntimeException
)
CalendarImpl
::
get
GenitiveMonth
s
()
throw
(
RuntimeException
)
{
if
(
xCalendar
.
is
())
return
xCalendar
->
get
Day
s
();
return
xCalendar
->
get
GenitiveMonth
s
();
else
throw
ERROR
;
}
...
...
i18npool/source/calendar/calendar_gregorian.cxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -246,7 +246,7 @@ Calendar_gregorian::loadCalendar( const OUString& uniqueID, const com::sun::star
getValue
();
aLocale
=
rLocale
;
Sequence
<
Calendar
>
xC
=
LocaleData
().
getAllCalendars
(
rLocale
);
Sequence
<
Calendar
2
>
xC
=
LocaleData
().
getAllCalendars2
(
rLocale
);
for
(
sal_Int32
i
=
0
;
i
<
xC
.
getLength
();
i
++
)
{
if
(
uniqueID
==
xC
[
i
].
Name
)
...
...
@@ -272,9 +272,16 @@ Calendar_gregorian::loadCalendar( const OUString& uniqueID, const com::sun::star
}
com
::
sun
::
star
::
i18n
::
Calendar2
SAL_CALL
Calendar_gregorian
::
getLoadedCalendar2
()
throw
(
RuntimeException
)
{
return
aCalendar
;
}
com
::
sun
::
star
::
i18n
::
Calendar
SAL_CALL
Calendar_gregorian
::
getLoadedCalendar
()
throw
(
RuntimeException
)
{
// gets "down-copy-constructed"
return
aCalendar
;
}
...
...
@@ -838,6 +845,8 @@ static sal_Int32 SAL_CALL DisplayCode2FieldIndex(sal_Int32 nCalendarDisplayCode)
case
CalendarDisplayCode
:
:
LONG_MONTH
:
case
CalendarDisplayCode
:
:
SHORT_MONTH_NAME
:
case
CalendarDisplayCode
:
:
LONG_MONTH_NAME
:
case
CalendarDisplayCode
:
:
SHORT_GENITIVE_MONTH_NAME
:
case
CalendarDisplayCode
:
:
LONG_GENITIVE_MONTH_NAME
:
return
CalendarFieldIndex
::
MONTH
;
case
CalendarDisplayCode
:
:
SHORT_YEAR
:
case
CalendarDisplayCode
:
:
LONG_YEAR
:
...
...
@@ -898,6 +907,13 @@ Calendar_gregorian::getNumberOfDaysInWeek() throw(RuntimeException)
}
Sequence
<
CalendarItem
>
SAL_CALL
Calendar_gregorian
::
getDays
()
throw
(
RuntimeException
)
{
return
aCalendar
.
Days
;
}
Sequence
<
CalendarItem
>
SAL_CALL
Calendar_gregorian
::
getMonths
()
throw
(
RuntimeException
)
{
...
...
@@ -906,11 +922,12 @@ Calendar_gregorian::getMonths() throw(RuntimeException)
Sequence
<
CalendarItem
>
SAL_CALL
Calendar_gregorian
::
get
Day
s
()
throw
(
RuntimeException
)
Calendar_gregorian
::
get
GenitiveMonth
s
()
throw
(
RuntimeException
)
{
return
aCalendar
.
Day
s
;
return
aCalendar
.
GenitiveMonth
s
;
}
OUString
SAL_CALL
Calendar_gregorian
::
getDisplayName
(
sal_Int16
displayIndex
,
sal_Int16
idx
,
sal_Int16
nameType
)
throw
(
RuntimeException
)
{
...
...
@@ -934,6 +951,12 @@ Calendar_gregorian::getDisplayName( sal_Int16 displayIndex, sal_Int16 idx, sal_I
else
if
(
nameType
==
1
)
aStr
=
aCalendar
.
Months
[
idx
].
FullName
;
else
throw
ERROR
;
break
;
case
CalendarDisplayIndex
:
:
GENITIVE_MONTH
:
if
(
idx
>=
aCalendar
.
GenitiveMonths
.
getLength
()
)
throw
ERROR
;
if
(
nameType
==
0
)
aStr
=
aCalendar
.
GenitiveMonths
[
idx
].
AbbrevName
;
else
if
(
nameType
==
1
)
aStr
=
aCalendar
.
GenitiveMonths
[
idx
].
FullName
;
else
throw
ERROR
;
break
;
case
CalendarDisplayIndex
:
:
ERA
:
if
(
idx
>=
aCalendar
.
Eras
.
getLength
()
)
throw
ERROR
;
if
(
nameType
==
0
)
aStr
=
aCalendar
.
Eras
[
idx
].
AbbrevName
;
...
...
@@ -1016,6 +1039,10 @@ Calendar_gregorian::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16
return
getDisplayName
(
CalendarDisplayIndex
::
MONTH
,
value
,
0
);
case
CalendarDisplayCode
:
:
LONG_MONTH_NAME
:
return
getDisplayName
(
CalendarDisplayIndex
::
MONTH
,
value
,
1
);
case
CalendarDisplayCode
:
:
SHORT_GENITIVE_MONTH_NAME
:
return
getDisplayName
(
CalendarDisplayIndex
::
GENITIVE_MONTH
,
value
,
0
);
case
CalendarDisplayCode
:
:
LONG_GENITIVE_MONTH_NAME
:
return
getDisplayName
(
CalendarDisplayIndex
::
GENITIVE_MONTH
,
value
,
1
);
case
CalendarDisplayCode
:
:
SHORT_ERA
:
return
getDisplayName
(
CalendarDisplayIndex
::
ERA
,
value
,
0
);
case
CalendarDisplayCode
:
:
LONG_ERA
:
...
...
i18npool/source/localedata/localedata.cxx
Dosyayı görüntüle @
a7dbdbf8
...
...
@@ -468,7 +468,7 @@ oslGenericFunction SAL_CALL lcl_LookupTableHelper::getFunctionSymbolByName(
#define REF_OFFSET_COUNT 4
Sequence
<
CalendarItem
>
&
LocaleData
::
getCalendarItemByName
(
const
OUString
&
name
,
const
Locale
&
rLocale
,
const
Sequence
<
Calendar
>&
calendarsSeq
,
sal_Int16
item
)
const
Locale
&
rLocale
,
const
Sequence
<
Calendar
2
>&
calendarsSeq
,
sal_Int16
item
)
throw
(
RuntimeException
)
{
if
(
!
ref_name
.
equals
(
name
))
{
...
...
@@ -476,11 +476,11 @@ Sequence< CalendarItem > &LocaleData::getCalendarItemByName(const OUString& name
OUString
language
=
name
.
getToken
(
0
,
under
,
index
);
OUString
country
=
name
.
getToken
(
0
,
under
,
index
);
Locale
loc
(
language
,
country
,
OUString
());
Sequence
<
Calendar
>
cals
;
Sequence
<
Calendar
2
>
cals
;
if
(
loc
==
rLocale
)
{
cals
=
calendarsSeq
;
}
else
{
cals
=
getAllCalendars
(
loc
);
cals
=
getAllCalendars
2
(
loc
);
}
const
OUString
&
id
=
name
.
getToken
(
0
,
under
,
index
);
for
(
index
=
0
;
index
<
cals
.
getLength
();
index
++
)
{
...
...
@@ -491,7 +491,7 @@ Sequence< CalendarItem > &LocaleData::getCalendarItemByName(const OUString& name
}
// Referred locale not found, return name for en_US locale.
if
(
index
==
cals
.
getLength
())
{
cals
=
getAllCalendars
(
cals
=
getAllCalendars
2
(
Locale
(
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"en"
)),
OUString
(
RTL_CONSTASCII_USTRINGPARAM
(
"US"
)),
OUString
()));
if
(
cals
.
getLength
()
>
0
)
ref_cal
=
cals
[
0
];
...
...
@@ -500,14 +500,27 @@ Sequence< CalendarItem > &LocaleData::getCalendarItemByName(const OUString& name
}
ref_name
=
name
;
}
return
item
==
REF_DAYS
?
ref_cal
.
Days
:
item
==
REF_MONTHS
?
ref_cal
.
Months
:
ref_cal
.
Eras
;
switch
(
item
)
{
case
REF_DAYS
:
return
ref_cal
.
Days
;
case
REF_MONTHS
:
return
ref_cal
.
Months
;
case
REF_GMONTHS
:
return
ref_cal
.
GenitiveMonths
;
default
:
OSL_FAIL
(
"LocaleData::getCalendarItemByName: unhandled REF_* case"
);
// fallthru
case
REF_ERAS
:
return
ref_cal
.
Eras
;
}
}
Sequence
<
CalendarItem
>
LocaleData
::
getCalendarItems
(
sal_Unicode
const
*
const
*
const
allCalendars
,
sal_Int16
&
rnOffset
,
const
sal_Int16
nWhichItem
,
const
sal_Int16
nCalendar
,
const
Locale
&
rLocale
,
const
Sequence
<
Calendar
>
&
calendarsSeq
)
const
Locale
&
rLocale
,
const
Sequence
<
Calendar
2
>
&
calendarsSeq
)
throw
(
RuntimeException
)
{
Sequence
<
CalendarItem
>
aItems
;
...
...
@@ -532,8 +545,8 @@ Sequence< CalendarItem > LocaleData::getCalendarItems(
}
Sequence
<
Calendar
>
SAL_CALL
LocaleData
::
getAllCalendars
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
Sequence
<
Calendar
2
>
SAL_CALL
LocaleData
::
getAllCalendars
2
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
sal_Unicode
const
*
const
*
allCalendars
=
NULL
;
...
...
@@ -544,7 +557,7 @@ LocaleData::getAllCalendars( const Locale& rLocale ) throw(RuntimeException)
sal_Int16
calendarsCount
=
0
;
allCalendars
=
func
(
calendarsCount
);
Sequence
<
Calendar
>
calendarsSeq
(
calendarsCount
);
Sequence
<
Calendar
2
>
calendarsSeq
(
calendarsCount
);
sal_Int16
offset
=
REF_OFFSET_COUNT
;
for
(
sal_Int16
i
=
0
;
i
<
calendarsCount
;
i
++
)
{
OUString
calendarID
(
allCalendars
[
offset
]);
...
...
@@ -563,19 +576,35 @@ LocaleData::getAllCalendars( const Locale& rLocale ) throw(RuntimeException)
offset
++
;
sal_Int16
minimalDaysInFirstWeek
=
allCalendars
[
offset
][
0
];
offset
++
;
Calendar
aCalendar
(
days
,
months
,
eras
,
startOfWeekDay
,
minimalDaysInFirstWeek
,
defaultCalendar
,
calendarID
);
Calendar
2
aCalendar
(
days
,
months
,
eras
,
startOfWeekDay
,
minimalDaysInFirstWeek
,
defaultCalendar
,
calendarID
,
gmonths
);
calendarsSeq
[
i
]
=
aCalendar
;
}
return
calendarsSeq
;
}
else
{
Sequence
<
Calendar
>
seq1
(
0
);
Sequence
<
Calendar
2
>
seq1
(
0
);
return
seq1
;
}
}
Sequence
<
Calendar
>
SAL_CALL
LocaleData
::
getAllCalendars
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
Sequence
<
Calendar2
>
aCal2
(
getAllCalendars2
(
rLocale
));
sal_Int32
nLen
=
aCal2
.
getLength
();
Sequence
<
Calendar
>
aCal1
(
nLen
);
const
Calendar2
*
p2
=
aCal2
.
getArray
();
Calendar
*
p1
=
aCal1
.
getArray
();
for
(
sal_Int32
i
=
0
;
i
<
nLen
;
++
i
,
++
p1
,
++
p2
)
{
*
p1
=
*
p2
;
}
return
aCal1
;
}
Sequence
<
Currency2
>
SAL_CALL
LocaleData
::
getAllCurrencies2
(
const
Locale
&
rLocale
)
throw
(
RuntimeException
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment