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
17f9d386
Kaydet (Commit)
17f9d386
authored
Haz 10, 2010
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
locales33a: #i111019# fixed locale parser/composer for three-letter language codes
üst
a6d2fd89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
locale.h
sal/inc/rtl/locale.h
+4
-4
nlsupport.c
sal/osl/unx/nlsupport.c
+10
-5
No files found.
sal/inc/rtl/locale.h
Dosyayı görüntüle @
17f9d386
...
...
@@ -49,7 +49,7 @@ extern "C" {
typedef
struct
_rtl_Locale
{
/**
Lowercase two-letter ISO
-639
code.
Lowercase two-letter ISO
639-1 or three-letter ISO 639-3
code.
*/
rtl_uString
*
Language
;
/**
...
...
@@ -72,7 +72,7 @@ typedef struct _rtl_Locale
/**
Register a locale from language, country and variant.
@param language lowercase two-letter ISO
-639
code.
@param language lowercase two-letter ISO
639-1 or three-letter ISO 639-3
code.
@param country uppercase two-letter ISO-3166 code. May be null.
@param variant vendor and browser specific code. May be null.
*/
...
...
@@ -95,7 +95,7 @@ rtl_Locale * SAL_CALL rtl_locale_getDefault();
Sets the default.
Normally set once at the beginning of applet or application,
then never reset. <code>setDefault</code> does not reset the host locale.
@param language lowercase two-letter ISO
-639
code.
@param language lowercase two-letter ISO
639-1 or three-letter ISO 639-3
code.
@param country uppercase two-letter ISO-3166 code.
@param variant vendor and browser specific code. See class description.
*/
...
...
@@ -103,7 +103,7 @@ void SAL_CALL rtl_locale_setDefault( const sal_Unicode * language, const sal_Uni
/**
Getter for programmatic name of field,
a
n lowercased two-letter ISO-639
code.
a
lowercased two-letter ISO 639-1 or three-letter ISO 639-3
code.
@see #getDisplayLanguage
*/
rtl_uString
*
SAL_CALL
rtl_locale_getLanguage
(
rtl_Locale
*
This
);
...
...
sal/osl/unx/nlsupport.c
Dosyayı görüntüle @
17f9d386
...
...
@@ -105,7 +105,8 @@ _pair_search (const char *key, const _pair *base, unsigned int member )
static
char
*
_compose_locale
(
rtl_Locale
*
pLocale
,
char
*
buffer
,
size_t
n
)
{
/* check if a valid locale is specified */
if
(
pLocale
&&
pLocale
->
Language
&&
(
pLocale
->
Language
->
length
==
2
)
)
if
(
pLocale
&&
pLocale
->
Language
&&
(
pLocale
->
Language
->
length
==
2
||
pLocale
->
Language
->
length
==
3
)
)
{
size_t
offset
=
0
;
...
...
@@ -193,16 +194,20 @@ static rtl_Locale * _parse_locale( const char * locale )
rtl_Locale
*
ret
;
/* language is a two or three letter code */
if
(
(
len
>
3
&&
'_'
==
locale
[
3
])
||
(
len
==
3
&&
'_'
!=
locale
[
2
])
)
offset
=
3
;
/* convert language code to unicode */
rtl_string2UString
(
&
pLanguage
,
locale
,
2
,
RTL_TEXTENCODING_ASCII_US
,
OSTRING_TO_OUSTRING_CVTFLAGS
);
rtl_string2UString
(
&
pLanguage
,
locale
,
offset
,
RTL_TEXTENCODING_ASCII_US
,
OSTRING_TO_OUSTRING_CVTFLAGS
);
OSL_ASSERT
(
pLanguage
!=
NULL
);
/* convert country code to unicode */
if
(
len
>=
5
&&
'_'
==
locale
[
2
]
)
if
(
len
>=
offset
+
3
&&
'_'
==
locale
[
offset
]
)
{
rtl_string2UString
(
&
pCountry
,
locale
+
3
,
2
,
RTL_TEXTENCODING_ASCII_US
,
OSTRING_TO_OUSTRING_CVTFLAGS
);
rtl_string2UString
(
&
pCountry
,
locale
+
offset
+
1
,
2
,
RTL_TEXTENCODING_ASCII_US
,
OSTRING_TO_OUSTRING_CVTFLAGS
);
OSL_ASSERT
(
pCountry
!=
NULL
);
offset
=
5
;
offset
+=
3
;
}
/* convert variant code to unicode - do not rely on "." as delimiter */
...
...
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