summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fgas/crt/fgas_language.h269
-rw-r--r--xfa/fxfa/parser/cxfa_localemgr.cpp120
-rw-r--r--xfa/fxfa/parser/cxfa_localemgr.h16
3 files changed, 59 insertions, 346 deletions
diff --git a/xfa/fgas/crt/fgas_language.h b/xfa/fgas/crt/fgas_language.h
deleted file mode 100644
index 21d68e68a1..0000000000
--- a/xfa/fgas/crt/fgas_language.h
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef XFA_FGAS_CRT_FGAS_LANGUAGE_H_
-#define XFA_FGAS_CRT_FGAS_LANGUAGE_H_
-
-#define FX_LANG_Neutral 0x0000
-#define FX_LANG_Invariant 0x007f
-#define FX_LANG_UserDefault 0x0400
-#define FX_LANG_SystemDefault 0x0800
-#define FX_LANG_Afrikaans_SouthAfrica 0x0436
-#define FX_LANG_Albanian_Albania 0x041c
-#define FX_LANG_Alsatian_France 0x0484
-#define FX_LANG_Amharic_Ethiopia 0x045e
-#define FX_LANG_Arabic_Algeria 0x1401
-#define FX_LANG_Arabic_Bahrain 0x3c01
-#define FX_LANG_Arabic_Egypt 0x0c01
-#define FX_LANG_Arabic_Iraq 0x0801
-#define FX_LANG_Arabic_Jordan 0x2c01
-#define FX_LANG_Arabic_Kuwait 0x3401
-#define FX_LANG_Arabic_Lebanon 0x3001
-#define FX_LANG_Arabic_Libya 0x1001
-#define FX_LANG_Arabic_Morocco 0x1801
-#define FX_LANG_Arabic_Oman 0x2001
-#define FX_LANG_Arabic_Qatar 0x4001
-#define FX_LANG_Arabic_SaudiArabia 0x0401
-#define FX_LANG_Arabic_Syria 0x2801
-#define FX_LANG_Arabic_Tunisia 0x1c01
-#define FX_LANG_Arabic_UAE 0x3801
-#define FX_LANG_Arabic_Yemen 0x2401
-#define FX_LANG_Armenian_Armenia 0x042b
-#define FX_LANG_Assamese_India 0x044d
-#define FX_LANG_Azerbaijan_Cyrillic 0x082c
-#define FX_LANG_Azerbaijan_Latin 0x042c
-#define FX_LANG_Bashkir_Russia 0x046d
-#define FX_LANG_Basque_Basque 0x042d
-#define FX_LANG_Belarusian_Belarus 0x0423
-#define FX_LANG_Bengali_Bangladesh 0x0845
-#define FX_LANG_Bengali_India 0x0445
-#define FX_LANG_Bosnia_Herzegovina 0x101a
-#define FX_LANG_Bosnian_Cyrillic 0x201a
-#define FX_LANG_Bosnian_Latin 0x141a
-#define FX_LANG_Breton_France 0x047e
-#define FX_LANG_Bulgarian_Bulgaria 0x0402
-#define FX_LANG_Burmese 0x0455
-#define FX_LANG_Catalan_Catalan 0x0403
-#define FX_LANG_Cherokee 0x045c
-#define FX_LANG_Chinese_HongKong 0x0c04
-#define FX_LANG_Chinese_Macao 0x1404
-#define FX_LANG_Chinese_PRC 0x0804
-#define FX_LANG_Chinese_Singapore 0x1004
-#define FX_LANG_Chinese_Taiwan 0x0404
-#define FX_LANG_Corsican_France 0x0483
-#define FX_LANG_Croatian_Croatia 0x041a
-#define FX_LANG_Croatian_Latin 0x101a
-#define FX_LANG_CustomCurrent 0x0c00
-#define FX_LANG_CzechRepublic 0x0405
-#define FX_LANG_Danish_Denmark 0x0406
-#define FX_LANG_Dari_Afghanistan 0x048c
-#define FX_LANG_Divehi_Maldives 0x0465
-#define FX_LANG_Dutch_Belgium 0x0813
-#define FX_LANG_Dutch_Netherlands 0x0413
-#define FX_LANG_Dutch_Preferred 0x0013
-#define FX_LANG_Dzongkha 0x0851
-#define FX_LANG_Edo 0x0466
-#define FX_LANG_English_Australia 0x0c09
-#define FX_LANG_English_Belize 0x2809
-#define FX_LANG_English_Canada 0x1009
-#define FX_LANG_English_Caribbean 0x2409
-#define FX_LANG_English_HongKong 0x3c09
-#define FX_LANG_English_India 0x4009
-#define FX_LANG_English_Indonesia 0x3809
-#define FX_LANG_English_Ireland 0x1809
-#define FX_LANG_English_Jamaica 0x2009
-#define FX_LANG_English_Malaysia 0x4409
-#define FX_LANG_English_NewZealand 0x1409
-#define FX_LANG_English_Philippines 0x3409
-#define FX_LANG_English_Singapore 0x4809
-#define FX_LANG_English_SouthAfrica 0x1c09
-#define FX_LANG_English_TrinidadTobago 0x2c09
-#define FX_LANG_English_UnitedKingdom 0x0809
-#define FX_LANG_English_UnitedStates 0x0409
-#define FX_LANG_English_Zimbabwe 0x3009
-#define FX_LANG_Estonian_Estonia 0x0425
-#define FX_LANG_Faroese_FaroeIslands 0x0438
-#define FX_LANG_Filipino_Philippines 0x0464
-#define FX_LANG_Finnish_Finland 0x040b
-#define FX_LANG_French_Belgium 0x080c
-#define FX_LANG_French_Cameroon 0x2c0c
-#define FX_LANG_French_Canada 0x0c0c
-#define FX_LANG_French_CongoDRC 0x240c
-#define FX_LANG_French_CotedIvoire 0x300c
-#define FX_LANG_French_France 0x040c
-#define FX_LANG_French_Haiti 0x3c0c
-#define FX_LANG_French_Luxembourg 0x140c
-#define FX_LANG_French_Mali 0x340c
-#define FX_LANG_French_Monaco 0x180c
-#define FX_LANG_French_Morocco 0x380c
-#define FX_LANG_French_Reunion 0x200c
-#define FX_LANG_French_Senegal 0x280c
-#define FX_LANG_French_Switzerland 0x100c
-#define FX_LANG_French_WestIndies 0x1c0c
-#define FX_LANG_Frisian_Netherlands 0x0462
-#define FX_LANG_Fulfulde 0x0467
-#define FX_LANG_Gaelic_Ireland 0x083c
-#define FX_LANG_Gaelic_Scotland 0x043c
-#define FX_LANG_Galician_Galician 0x0456
-#define FX_LANG_Georgian_Georgia 0x0437
-#define FX_LANG_German_Austria 0x0c07
-#define FX_LANG_German_Germany 0x0407
-#define FX_LANG_German_Liechtenstein 0x1407
-#define FX_LANG_German_Luxembourg 0x1007
-#define FX_LANG_German_Switzerland 0x0807
-#define FX_LANG_Greek_Greece 0x0408
-#define FX_LANG_Greenlandic_Greenland 0x046f
-#define FX_LANG_Guarani 0x0474
-#define FX_LANG_Gujarati_India 0x0447
-#define FX_LANG_Hausa_LatinNigeria 0x0468
-#define FX_LANG_Hawaiian 0x0475
-#define FX_LANG_Hebrew_Israel 0x040d
-#define FX_LANG_Hindi_India 0x0439
-#define FX_LANG_Hungarian_Hungary 0x040e
-#define FX_LANG_Ibibio_Nigeria 0x0469
-#define FX_LANG_Icelandic_Iceland 0x040f
-#define FX_LANG_Igbo_Nigeria 0x0470
-#define FX_LANG_Indonesian_Indonesia 0x0421
-#define FX_LANG_Inuktitut_LatinCanada 0x085d
-#define FX_LANG_Inuktitut_SyllabicsCanada 0x045d
-#define FX_LANG_IsiXhosa_SouthAfrica 0x0434
-#define FX_LANG_IsiZulu_SouthAfrica 0x0435
-#define FX_LANG_Italian_Italy 0x0410
-#define FX_LANG_Italian_Switzerland 0x0810
-#define FX_LANG_Japanese_Japan 0x0411
-#define FX_LANG_Kannada_India 0x044b
-#define FX_LANG_Kanuri 0x0471
-#define FX_LANG_Kashmiri 0x0860
-#define FX_LANG_Kashmiri_Arabic 0x0460
-#define FX_LANG_Kazakh_Kazakhstan 0x043f
-#define FX_LANG_Khmer_Cambodia 0x0453
-#define FX_LANG_Kiche_Guatemala 0x0486
-#define FX_LANG_Kinyarwanda_Rwanda 0x0487
-#define FX_LANG_Kiswahili_Kenya 0x0441
-#define FX_LANG_Konkani_India 0x0457
-#define FX_LANG_Korean_Korea 0x0412
-#define FX_LANG_Kyrgyz_Kyrgyzstan 0x0440
-#define FX_LANG_Lao_LaoPDR 0x0454
-#define FX_LANG_Latin 0x0476
-#define FX_LANG_Latvian_Latvia 0x0426
-#define FX_LANG_Lithuanian_Lithuania 0x0427
-#define FX_LANG_LithuanianTrad 0x0827
-#define FX_LANG_Lower Sorbian_Germany 0x082e
-#define FX_LANG_Luxembourgish_Luxembourg 0x046e
-#define FX_LANG_Macedonian 0x042f
-#define FX_LANG_Malay_BruneiDarussalam 0x083e
-#define FX_LANG_Malay_Malaysia 0x043e
-#define FX_LANG_Malayalam_India 0x044c
-#define FX_LANG_Maldivian 0x0465
-#define FX_LANG_Maltese_Malta 0x043a
-#define FX_LANG_Manipuri 0x0458
-#define FX_LANG_Maori_NewZealand 0x0481
-#define FX_LANG_Mapudungun_Chile 0x047a
-#define FX_LANG_Marathi_India 0x044e
-#define FX_LANG_Mohawk_Mohawk 0x047c
-#define FX_LANG_Mongolian_CyrillicMongolia 0x0450
-#define FX_LANG_Mongolian_TraditionalMongolian 0x0850
-#define FX_LANG_Nepali_India 0x0861
-#define FX_LANG_Nepali_Nepal 0x0461
-#define FX_LANG_Norwegian_Bokmal 0x0414
-#define FX_LANG_Norwegian_Nynorsk 0x0814
-#define FX_LANG_Occitan_France 0x0482
-#define FX_LANG_Oriya_India 0x0448
-#define FX_LANG_Oromo 0x0472
-#define FX_LANG_Papiamentu 0x0479
-#define FX_LANG_Pashto_Afghanistan 0x0463
-#define FX_LANG_Persian 0x0429
-#define FX_LANG_Polish_Poland 0x0415
-#define FX_LANG_Portuguese_Brazil 0x0416
-#define FX_LANG_Portuguese_Portugal 0x0816
-#define FX_LANG_Punjabi_India 0x0446
-#define FX_LANG_Punjabi_Pakistan 0x0846
-#define FX_LANG_Quechua_Bolivia 0x046b
-#define FX_LANG_Quechua_Ecuador 0x086b
-#define FX_LANG_Quechua_Peru 0x0c6b
-#define FX_LANG_Romanian_Moldova 0x0818
-#define FX_LANG_Romanian_Romania 0x0418
-#define FX_LANG_Romansh_Switzerland 0x0417
-#define FX_LANG_Russian_Moldova 0x0819
-#define FX_LANG_Russian_Russia 0x0419
-#define FX_LANG_Sami_InariFinland 0x243b
-#define FX_LANG_Sami_LuleNorway 0x103b
-#define FX_LANG_Sami_LuleSweden 0x143b
-#define FX_LANG_Sami_NorthernFinland 0x0c3b
-#define FX_LANG_Sami_NorthernNorway 0x043b
-#define FX_LANG_Sami_NorthernSweden 0x083b
-#define FX_LANG_Sami_SkoltFinland 0x203b
-#define FX_LANG_Sami_SouthernNorway 0x183b
-#define FX_LANG_Sami_SouthernSweden 0x1c3b
-#define FX_LANG_SanskritIndia 0x044f
-#define FX_LANG_SerbianCyrillic_BosniaHerzegovina 0x1c1a
-#define FX_LANG_SerbianCyrillic_Serbia 0x0c1a
-#define FX_LANG_SerbianLatin_BosniaHerzegovina 0x181a
-#define FX_LANG_SerbianLatin_Serbia 0x081a
-#define FX_LANG_SesothoSaLeboa 0x046c
-#define FX_LANG_Setswana_SouthAfrica 0x0432
-#define FX_LANG_Sindhi_Arabic 0x0859
-#define FX_LANG_Sindhi_Devanagari 0x0459
-#define FX_LANG_Sinhala_SriLanka 0x045b
-#define FX_LANG_Slovak_Slovakia 0x041b
-#define FX_LANG_Slovenian_Slovenia 0x0424
-#define FX_LANG_Somali 0x0477
-#define FX_LANG_Spanish_Argentina 0x2c0a
-#define FX_LANG_Spanish_Bolivia 0x400a
-#define FX_LANG_Spanish_Chile 0x340a
-#define FX_LANG_Spanish_Colombia 0x240a
-#define FX_LANG_Spanish_CostaRica 0x140a
-#define FX_LANG_Spanish_DominicanRepublic 0x1c0a
-#define FX_LANG_Spanish_Ecuador 0x300a
-#define FX_LANG_Spanish_ElSalvador 0x440a
-#define FX_LANG_Spanish_Guatemala 0x100a
-#define FX_LANG_Spanish_Honduras 0x480a
-#define FX_LANG_Spanish_Mexico 0x080a
-#define FX_LANG_Spanish_Nicaragua 0x4c0a
-#define FX_LANG_Spanish_Panama 0x180a
-#define FX_LANG_Spanish_Paraguay 0x3c0a
-#define FX_LANG_Spanish_Peru 0x280a
-#define FX_LANG_Spanish_PuertoRico 0x500a
-#define FX_LANG_Spanish_InternationalSort 0x0c0a
-#define FX_LANG_Spanish_TraditionalSort 0x040a
-#define FX_LANG_Spanish_UnitedStates 0x540a
-#define FX_LANG_Spanish_Uruguay 0x380a
-#define FX_LANG_Spanish_Venezuela 0x200a
-#define FX_LANG_Sutu_SouthAfrica 0x0430
-#define FX_LANG_Swedish_Finland 0x081d
-#define FX_LANG_Swedish_Sweden 0x041d
-#define FX_LANG_Syriac_Syria 0x045a
-#define FX_LANG_Tajik_CyrillicTajikistan 0x0428
-#define FX_LANG_Tamazight_ArabicMorocco 0x045f
-#define FX_LANG_Tamazight_LatinAlgeria 0x085f
-#define FX_LANG_Tamil_India 0x0449
-#define FX_LANG_Tatar_Russia 0x0444
-#define FX_LANG_Telugu_India 0x044a
-#define FX_LANG_Thai_Thailand 0x041e
-#define FX_LANG_TibetanPRC 0x0451
-#define FX_LANG_Tigrigna_Eritrea 0x0873
-#define FX_LANG_Tigrigna_Ethiopia 0x0473
-#define FX_LANG_Tsonga 0x0431
-#define FX_LANG_Turkish_Turkey 0x041f
-#define FX_LANG_Turkmen_Turkmenistan 0x0442
-#define FX_LANG_UighurPRC 0x0480
-#define FX_LANG_Ukrainian_Ukraine 0x0422
-#define FX_LANG_UpperSorbian_Germany 0x042e
-#define FX_LANG_Urdu_Pakistan 0x0420
-#define FX_LANG_Urdu_India 0x0820
-#define FX_LANG_Uzbek_CyrillicUzbekistan 0x0843
-#define FX_LANG_Uzbek_LatinUzbekistan 0x0443
-#define FX_LANG_Venda 0x0433
-#define FX_LANG_Vietnamese_Vietnam 0x042a
-#define FX_LANG_Welsh_UnitedKingdom 0x0452
-#define FX_LANG_Wolof_Senegal 0x0488
-#define FX_LANG_Xhosa 0x0434
-#define FX_LANG_Yakut_Russia 0x0485
-#define FX_LANG_YiPRC 0x0478
-#define FX_LANG_Yiddish 0x043d
-#define FX_LANG_Yoruba_Nigeria 0x046a
-
-#endif // XFA_FGAS_CRT_FGAS_LANGUAGE_H_
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp
index b082857633..0f50803763 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_localemgr.cpp
@@ -19,6 +19,22 @@
#include "xfa/fxfa/parser/cxfa_xmllocale.h"
#include "xfa/fxfa/parser/xfa_utils.h"
+#define FX_LANG_zh_HK 0x0c04
+#define FX_LANG_zh_CN 0x0804
+#define FX_LANG_zh_TW 0x0404
+#define FX_LANG_nl_NL 0x0413
+#define FX_LANG_en_GB 0x0809
+#define FX_LANG_en_US 0x0409
+#define FX_LANG_fr_FR 0x040c
+#define FX_LANG_de_DE 0x0407
+#define FX_LANG_it_IT 0x0410
+#define FX_LANG_ja_JP 0x0411
+#define FX_LANG_ko_KR 0x0412
+#define FX_LANG_pt_BR 0x0416
+#define FX_LANG_ru_RU 0x0419
+#define FX_LANG_es_LA 0x080a
+#define FX_LANG_es_ES 0x0c0a
+
const uint8_t g_enUS_Locale[] = {
0x78, 0x9C, 0x95, 0x56, 0xD1, 0x6E, 0x9B, 0x30, 0x14, 0x7D, 0x9F, 0xB4,
0x7F, 0x40, 0xD6, 0x2A, 0xB5, 0x52, 0x56, 0x6F, 0x8F, 0xA9, 0x88, 0xA5,
@@ -1062,65 +1078,47 @@ static std::unique_ptr<IFX_Locale> XFA_GetLocaleFromBuffer(const uint8_t* pBuf,
}
static uint16_t XFA_GetLanguage(CFX_WideString wsLanguage) {
- uint16_t dwLangueID = XFA_LANGID_en_US;
- if (wsLanguage.GetLength() < 2) {
- return dwLangueID;
- }
+ if (wsLanguage.GetLength() < 2)
+ return FX_LANG_en_US;
+
wsLanguage.MakeLower();
uint32_t dwIDFirst = wsLanguage.GetAt(0) << 8 | wsLanguage.GetAt(1);
uint32_t dwIDSecond = wsLanguage.GetLength() >= 5
? wsLanguage.GetAt(3) << 8 | wsLanguage.GetAt(4)
: 0;
switch (dwIDFirst) {
- case FXBSTR_ID(0, 0, 'z', 'h'): {
- if (dwIDSecond == FXBSTR_ID(0, 0, 'c', 'n')) {
- dwLangueID = XFA_LANGID_zh_CN;
- } else if (dwIDSecond == FXBSTR_ID(0, 0, 't', 'w')) {
- dwLangueID = XFA_LANGID_zh_TW;
- } else if (dwIDSecond == FXBSTR_ID(0, 0, 'h', 'k')) {
- dwLangueID = XFA_LANGID_zh_HK;
- }
- } break;
- case FXBSTR_ID(0, 0, 'j', 'a'):
- dwLangueID = XFA_LANGID_ja_JP;
+ case FXBSTR_ID(0, 0, 'z', 'h'):
+ if (dwIDSecond == FXBSTR_ID(0, 0, 'c', 'n'))
+ return FX_LANG_zh_CN;
+ if (dwIDSecond == FXBSTR_ID(0, 0, 't', 'w'))
+ return FX_LANG_zh_TW;
+ if (dwIDSecond == FXBSTR_ID(0, 0, 'h', 'k'))
+ return FX_LANG_zh_HK;
break;
+ case FXBSTR_ID(0, 0, 'j', 'a'):
+ return FX_LANG_ja_JP;
case FXBSTR_ID(0, 0, 'k', 'o'):
- dwLangueID = XFA_LANGID_ko_KR;
- break;
- case FXBSTR_ID(0, 0, 'e', 'n'): {
- if (dwIDSecond == FXBSTR_ID(0, 0, 'g', 'b')) {
- dwLangueID = XFA_LANGID_en_GB;
- } else {
- dwLangueID = XFA_LANGID_en_US;
- }
- } break;
+ return FX_LANG_ko_KR;
+ case FXBSTR_ID(0, 0, 'e', 'n'):
+ return dwIDSecond == FXBSTR_ID(0, 0, 'g', 'b') ? FX_LANG_en_GB
+ : FX_LANG_en_US;
case FXBSTR_ID(0, 0, 'd', 'e'):
- dwLangueID = XFA_LANGID_de_DE;
- break;
+ return FX_LANG_de_DE;
case FXBSTR_ID(0, 0, 'f', 'r'):
- dwLangueID = XFA_LANGID_fr_FR;
- break;
- case FXBSTR_ID(0, 0, 'e', 's'): {
- if (dwIDSecond == FXBSTR_ID(0, 0, 'e', 's')) {
- dwLangueID = XFA_LANGID_es_ES;
- } else {
- dwLangueID = XFA_LANGID_es_LA;
- }
- } break;
+ return FX_LANG_fr_FR;
+ case FXBSTR_ID(0, 0, 'e', 's'):
+ return dwIDSecond == FXBSTR_ID(0, 0, 'e', 's') ? FX_LANG_es_ES
+ : FX_LANG_es_LA;
case FXBSTR_ID(0, 0, 'i', 't'):
- dwLangueID = XFA_LANGID_it_IT;
- break;
+ return FX_LANG_it_IT;
case FXBSTR_ID(0, 0, 'p', 't'):
- dwLangueID = XFA_LANGID_pt_BR;
- break;
+ return FX_LANG_pt_BR;
case FXBSTR_ID(0, 0, 'n', 'l'):
- dwLangueID = XFA_LANGID_nl_NL;
- break;
+ return FX_LANG_nl_NL;
case FXBSTR_ID(0, 0, 'r', 'u'):
- dwLangueID = XFA_LANGID_ru_RU;
- break;
+ return FX_LANG_ru_RU;
}
- return dwLangueID;
+ return FX_LANG_en_US;
}
CXFA_LocaleMgr::CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid)
@@ -1162,35 +1160,35 @@ IFX_Locale* CXFA_LocaleMgr::GetDefLocale() {
std::unique_ptr<IFX_Locale> CXFA_LocaleMgr::GetLocale(uint16_t lcid) {
switch (lcid) {
- case XFA_LANGID_zh_CN:
+ case FX_LANG_zh_CN:
return XFA_GetLocaleFromBuffer(g_zhCN_Locale, sizeof(g_zhCN_Locale));
- case XFA_LANGID_zh_TW:
+ case FX_LANG_zh_TW:
return XFA_GetLocaleFromBuffer(g_zhTW_Locale, sizeof(g_zhTW_Locale));
- case XFA_LANGID_zh_HK:
+ case FX_LANG_zh_HK:
return XFA_GetLocaleFromBuffer(g_zhHK_Locale, sizeof(g_zhHK_Locale));
- case XFA_LANGID_ja_JP:
+ case FX_LANG_ja_JP:
return XFA_GetLocaleFromBuffer(g_jaJP_Locale, sizeof(g_jaJP_Locale));
- case XFA_LANGID_ko_KR:
+ case FX_LANG_ko_KR:
return XFA_GetLocaleFromBuffer(g_koKR_Locale, sizeof(g_koKR_Locale));
- case XFA_LANGID_en_GB:
+ case FX_LANG_en_GB:
return XFA_GetLocaleFromBuffer(g_enGB_Locale, sizeof(g_enGB_Locale));
- case XFA_LANGID_es_LA:
+ case FX_LANG_es_LA:
return XFA_GetLocaleFromBuffer(g_esLA_Locale, sizeof(g_esLA_Locale));
- case XFA_LANGID_es_ES:
+ case FX_LANG_es_ES:
return XFA_GetLocaleFromBuffer(g_esES_Locale, sizeof(g_esES_Locale));
- case XFA_LANGID_de_DE:
+ case FX_LANG_de_DE:
return XFA_GetLocaleFromBuffer(g_deDE_Loacale, sizeof(g_deDE_Loacale));
- case XFA_LANGID_fr_FR:
+ case FX_LANG_fr_FR:
return XFA_GetLocaleFromBuffer(g_frFR_Locale, sizeof(g_frFR_Locale));
- case XFA_LANGID_it_IT:
+ case FX_LANG_it_IT:
return XFA_GetLocaleFromBuffer(g_itIT_Locale, sizeof(g_itIT_Locale));
- case XFA_LANGID_pt_BR:
+ case FX_LANG_pt_BR:
return XFA_GetLocaleFromBuffer(g_ptBR_Locale, sizeof(g_ptBR_Locale));
- case XFA_LANGID_nl_NL:
+ case FX_LANG_nl_NL:
return XFA_GetLocaleFromBuffer(g_nlNL_Locale, sizeof(g_nlNL_Locale));
- case XFA_LANGID_ru_RU:
+ case FX_LANG_ru_RU:
return XFA_GetLocaleFromBuffer(g_ruRU_Locale, sizeof(g_ruRU_Locale));
- case XFA_LANGID_en_US:
+ case FX_LANG_en_US:
default:
return XFA_GetLocaleFromBuffer(g_enUS_Locale, sizeof(g_enUS_Locale));
}
@@ -1210,8 +1208,8 @@ IFX_Locale* CXFA_LocaleMgr::GetLocaleByName(
if (pLocale->GetName() == wsLocaleName)
return pLocale;
}
- uint16_t dwLangueID = XFA_GetLanguage(wsLocaleName);
- std::unique_ptr<IFX_Locale> pLocale(GetLocale(dwLangueID));
+
+ std::unique_ptr<IFX_Locale> pLocale(GetLocale(XFA_GetLanguage(wsLocaleName)));
IFX_Locale* pRetLocale = pLocale.get();
if (pLocale)
m_XMLLocaleArray.push_back(std::move(pLocale));
diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h
index 307cc621d0..f730304c10 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.h
+++ b/xfa/fxfa/parser/cxfa_localemgr.h
@@ -17,22 +17,6 @@
class CXFA_Node;
class IFX_Locale;
-#define XFA_LANGID_zh_CN 0x0804
-#define XFA_LANGID_zh_TW 0x0404
-#define XFA_LANGID_zh_HK 0x0c04
-#define XFA_LANGID_ja_JP 0x0411
-#define XFA_LANGID_ko_KR 0x0412
-#define XFA_LANGID_en_US 0x0409
-#define XFA_LANGID_en_GB 0x0809
-#define XFA_LANGID_es_ES 0x0c0a
-#define XFA_LANGID_es_LA 0x080a
-#define XFA_LANGID_de_DE 0x0407
-#define XFA_LANGID_fr_FR 0x040c
-#define XFA_LANGID_it_IT 0x0410
-#define XFA_LANGID_pt_BR 0x0416
-#define XFA_LANGID_nl_NL 0x0413
-#define XFA_LANGID_ru_RU 0x0419
-
class CXFA_LocaleMgr {
public:
CXFA_LocaleMgr(CXFA_Node* pLocaleSet, CFX_WideString wsDeflcid);