[Libreoffice-commits] core.git: 3 commits - i18nlangtag/source
i18nlangtag/source/isolang/MS-LCID-to-list.sh | 23 i18nlangtag/source/isolang/MS-LCID.lst| 922 +- i18nlangtag/source/isolang/isolang.cxx|4 3 files changed, 482 insertions(+), 467 deletions(-) New commits: commit fdafa5302df26df4f147b0d2efb6064389a1330c Author: Eike Rathke er...@redhat.com Date: Sun Aug 23 00:46:07 2015 +0200 adapt mapping lines to current isolang.cxx entries and some usage comments Change-Id: I264d6e1ed52046e58284a2090eff3e8911c87f6a diff --git a/i18nlangtag/source/isolang/MS-LCID-to-list.sh b/i18nlangtag/source/isolang/MS-LCID-to-list.sh index 34fd709..0012bfc 100755 --- a/i18nlangtag/source/isolang/MS-LCID-to-list.sh +++ b/i18nlangtag/source/isolang/MS-LCID-to-list.sh @@ -10,10 +10,21 @@ # http://download.microsoft.com/download/9/5/E/95EF66AF-9026-4BB0-A41D-A4F81802D92C/%5BMS-LCID%5D.pdf # downloaded from http://msdn.microsoft.com/library/cc233965.aspx # At least this worked for Release: Monday, July 22, 2013; 08/08/2013 Revision 6.0 -# downloaded on 2013-10-17 +# Also worked for 6/30/2015 revision 7.0 # # Uses pdftotext (from poppler-utils), grep and gawk. -# Files created/overwritten: MS-LCID.txt, MS-LCID.lst, MS-LCID.lst.h +# +# The script expects the downloaded [MS-LCID].pdf as MS-LCID.pdf +# +# Files created/OVERWRITTEN: MS-LCID.txt, MS-LCID.lst, MS-LCID.lst.h +# +# Best invoked in a temporary directory ... +# Layout may change, diff MS-LCID.lst with ignore spaces against the previous +# version for changes and additions, e.g. +# gvimdiff -c 'set diffopt+=iwhite' ../MS-LCID.lst MS-LCID.lst +# The generated MS-LCID.lst.h file is only a copypaste help to add entries in +# isolang.cxx and not to be committed, the #define names have to be adapted for +# lang.h and isolang.cxx pdftotext -layout MS-LCID.pdf grep '^ *0x[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F] ' MS-LCID.txt MS-LCID.lst @@ -39,18 +50,18 @@ gawk -e ' { case 1: # lll -mapping = sprintf( { %-36s %5s, \\ , false },, usedef, \ arr[1] \); +mapping = sprintf( { %-36s %5s, \\ , 0 },, usedef, \ arr[1] \); break; case 2: if (length(arr[2]) == 2) { # lll-CC -mapping = sprintf( { %-36s %5s, \%s\, false },, usedef, \ arr[1] \, arr[2]); +mapping = sprintf( { %-36s %5s, \%s\, 0 },, usedef, \ arr[1] \, arr[2]); } else if (length(arr[2]) == 4) { # lll-Ssss -mapping = sprintf( { %-44s %10s, \\ },, usedef, \ tag \); +mapping = sprintf( { %-44s %10s, \\ , 0 },, usedef, \ tag \); } else { @@ -67,7 +78,7 @@ gawk -e ' else if (length(arr[2]) == 4) { # lll-Ssss-CC -mapping = sprintf( { %-44s %10s, \%s\ },, usedef, \ arr[1] - arr[2] \, arr[3]); +mapping = sprintf( { %-44s %10s, \%s\, 0 },, usedef, \ arr[1] - arr[2] \, arr[3]); } else { commit 304ce084e94c92d1b44b16ec1fd9d48dc24019c1 Author: Eike Rathke er...@redhat.com Date: Sun Aug 23 00:40:12 2015 +0200 new list of [MS-LCID] rev. 7.0 2015-06-30 See http://msdn.microsoft.com/library/cc233965.aspx Change-Id: I5b86a309049806c2c67fe185acc421bf20de89cd diff --git a/i18nlangtag/source/isolang/MS-LCID.lst b/i18nlangtag/source/isolang/MS-LCID.lst index 219157f..bc42d81 100644 --- a/i18nlangtag/source/isolang/MS-LCID.lst +++ b/i18nlangtag/source/isolang/MS-LCID.lst @@ -1,460 +1,462 @@ -0x0001 ar -0x0002 bg -0x0003 ca -0x0004 zh-Hans -0x0005 cs -0x0006 da -0x0007 de -0x0008 el -0x0009 en -0x000a es -0x000b fi -0x000c fr -0x000d he -0x000e hu -0x000f is -0x0010 it -0x0011 ja -0x0012 ko -0x0013 nl -0x0014 no -0x0015 pl -0x0016 pt -0x0017 rm -0x0018 ro -0x0019 ru -0x001a bs, hr, or sr -0x001b sk -0x001c sq -0x001d sv -0x001e th -0x001f tr -0x0020 ur -0x0021 id -0x0022 uk -0x0023 be -0x0024 sl -0x0025 et -0x0026 lv -0x0027 lt -0x0028
[Libreoffice-commits] core.git: 3 commits - i18nlangtag/source i18npool/Library_localedata_others.mk i18npool/source include/i18nlangtag svtools/source
i18nlangtag/source/isolang/isolang.cxx |1 i18npool/Library_localedata_others.mk |1 i18npool/source/localedata/data/lgr_SB.xml | 359 + i18npool/source/localedata/localedata.cxx |3 include/i18nlangtag/lang.h |1 svtools/source/misc/langtab.src|1 6 files changed, 365 insertions(+), 1 deletion(-) New commits: commit 1371fbf08bae2e1d2282af19af9ce3c20ebe03f7 Author: Eike Rathke er...@redhat.com Date: Wed Feb 26 20:23:25 2014 +0100 added M-D abbreviated DateAcceptancePattern to [lgr-SB], fdo#72512 Change-Id: Ia42f4a112a240ed38a9e8e53e4e92b48e9cacc10 diff --git a/i18npool/source/localedata/data/lgr_SB.xml b/i18npool/source/localedata/data/lgr_SB.xml index 42f6369..f156c80 100644 --- a/i18npool/source/localedata/data/lgr_SB.xml +++ b/i18npool/source/localedata/data/lgr_SB.xml @@ -35,6 +35,7 @@ MeasurementSystemmetric/MeasurementSystem /LC_CTYPE LC_FORMAT replaceFrom=[CURRENCY] replaceTo=[$$-692] +DateAcceptancePatternM-D/DateAcceptancePattern FormatElement msgid=FixedFormatskey1 default=true type=medium usage=FIXED_NUMBER formatindex=0 FormatCodeGeneral/FormatCode /FormatElement commit 7f1d023cb8879cadb6ffeda6dbf9b1c8e83007e7 Author: Eike Rathke er...@redhat.com Date: Wed Feb 26 20:20:21 2014 +0100 added Lengo [lgr-SB] locale data, fdo#72512 Change-Id: I1aa5e635448e2076f60c749e2640d9689a63f829 diff --git a/i18npool/Library_localedata_others.mk b/i18npool/Library_localedata_others.mk index f1f1785..03447dc 100644 --- a/i18npool/Library_localedata_others.mk +++ b/i18npool/Library_localedata_others.mk @@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,localedata_others,\ CustomTarget/i18npool/localedata/localedata_ky_KG \ CustomTarget/i18npool/localedata/localedata_ldi_CG \ CustomTarget/i18npool/localedata/localedata_lg_UG \ + CustomTarget/i18npool/localedata/localedata_lgr_SB \ CustomTarget/i18npool/localedata/localedata_lif_NP \ CustomTarget/i18npool/localedata/localedata_ln_CD \ CustomTarget/i18npool/localedata/localedata_lo_LA \ diff --git a/i18npool/source/localedata/data/lgr_SB.xml b/i18npool/source/localedata/data/lgr_SB.xml new file mode 100644 index 000..42f6369 --- /dev/null +++ b/i18npool/source/localedata/data/lgr_SB.xml @@ -0,0 +1,358 @@ +?xml version=1.0 encoding=UTF-8 ? +!DOCTYPE Locale SYSTEM 'locale.dtd' +Locale versionDTD=2.0.3 allowUpdateFromCLDR=no version=1.0 + LC_INFO +Language + LangIDlgr/LangID + DefaultNameLengo/DefaultName +/Language +Country + CountryIDSB/CountryID + DefaultNameSolomon Islands/DefaultName +/Country + /LC_INFO + LC_CTYPE unoid=generic +Separators + DateSeparator-/DateSeparator + ThousandSeparator,/ThousandSeparator + DecimalSeparator./DecimalSeparator + TimeSeparator:/TimeSeparator + Time100SecSeparator./Time100SecSeparator + ListSeparator;/ListSeparator + LongDateDayOfWeekSeparator, /LongDateDayOfWeekSeparator + LongDateDaySeparator, /LongDateDaySeparator + LongDateMonthSeparator /LongDateMonthSeparator + LongDateYearSeparator /LongDateYearSeparator +/Separators +Markers + QuotationStartâ/QuotationStart + QuotationEndâ/QuotationEnd + DoubleQuotationStartâ/DoubleQuotationStart + DoubleQuotationEndâ/DoubleQuotationEnd +/Markers +TimeAMAM/TimeAM +TimePMPM/TimePM +MeasurementSystemmetric/MeasurementSystem + /LC_CTYPE + LC_FORMAT replaceFrom=[CURRENCY] replaceTo=[$$-692] +FormatElement msgid=FixedFormatskey1 default=true type=medium usage=FIXED_NUMBER formatindex=0 + FormatCodeGeneral/FormatCode +/FormatElement +FormatElement msgid=FixedFormatskey2 default=true type=short usage=FIXED_NUMBER formatindex=1 + FormatCode0/FormatCode +/FormatElement +FormatElement msgid=FixedFormatskey3 default=false type=medium usage=FIXED_NUMBER formatindex=2 + FormatCode0.00/FormatCode +/FormatElement +FormatElement msgid=FixedFormatskey4 default=false type=short usage=FIXED_NUMBER formatindex=3 + FormatCode#,##0/FormatCode +/FormatElement +FormatElement msgid=FixedFormatskey5 default=false type=medium usage=FIXED_NUMBER formatindex=4 + FormatCode#,##0.00/FormatCode +/FormatElement +FormatElement msgid=FixedFormatskey6 default=false type=medium usage=FIXED_NUMBER formatindex=5 + FormatCode#,###.00/FormatCode +/FormatElement +FormatElement msgid=ScientificFormatskey1 default=true type=medium usage=SCIENTIFIC_NUMBER formatindex=6 + FormatCode0.00E+00/FormatCode +/FormatElement +FormatElement msgid=ScientificFormatskey2 default=false type=medium usage=SCIENTIFIC_NUMBER formatindex=7 + FormatCode0.00E+000/FormatCode +/FormatElement +FormatElement msgid=PercentFormatskey1 default=true type=short
[Libreoffice-commits] core.git: 3 commits - i18nlangtag/source
i18nlangtag/source/isolang/isolang.cxx | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) New commits: commit 6056965245915d3aeb84e8ccd065133bdf21d806 Author: Eike Rathke er...@redhat.com Date: Thu Sep 12 17:29:37 2013 +0200 added known unhandled to IsoLanguageScriptCountryEntry Change-Id: Ica66ae2c7ced84c7d41537197447ebfebf02ddd7 diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index da29abf..1abf020 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -277,7 +277,6 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_CROATIAN,hr, HR, false }, // Croatian in Croatia { LANGUAGE_CROATIAN_BOSNIA_HERZEGOVINA, hr, BA, false }, { LANGUAGE_BOSNIAN_LATIN_BOSNIA_HERZEGOVINA,bs, BA, false }, -// { LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA, bs, BA, false }, // script codes not supported yet { LANGUAGE_USER_SERBIAN_CYRILLIC_SERBIA,sr, RS, false }, // Serbian Cyrillic in Serbia { LANGUAGE_SERBIAN_CYRILLIC,sr, CS, false }, // Serbian Cyrillic in Serbia and Montenegro { LANGUAGE_SERBIAN_CYRILLIC,sr, YU, true }, // legacy Serbian Cyrillic in Serbia and Montenegro (former Yugoslavia); kludge, sr_CS not supported by ICU 2.6 (3.4 does) @@ -290,10 +289,8 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_SERBIAN_LATIN_BOSNIA_HERZEGOVINA,sh, BA, true }, // legacy kludge, is sr-Latn-BA now { LANGUAGE_SERBIAN_LATIN_NEUTRAL, sh, , true }, // legacy kludge, is sr-Latn now { LANGUAGE_ARMENIAN,hy, AM, false }, -{ LANGUAGE_AZERI_LATIN, az, AZ, false }, -// { LANGUAGE_AZERI_CYRILLIC, az, AZ, false }, // script codes not supported yet -{ LANGUAGE_UZBEK_LATIN, uz, UZ, false }, -// { LANGUAGE_UZBEK_CYRILLIC, uz, UZ, false }, // script codes not supported yet +{ LANGUAGE_AZERI_LATIN, az, AZ, false },// macrolanguage code +{ LANGUAGE_UZBEK_LATIN, uz, UZ, false },// macrolanguage code { LANGUAGE_BENGALI_BANGLADESH, bn, BD, false }, { LANGUAGE_BENGALI, bn, IN, false }, { LANGUAGE_BURMESE, my, MM, false }, @@ -582,6 +579,9 @@ static IsoLanguageScriptCountryEntry const aImplIsoLangScriptEntries[] = { LANGUAGE_USER_SERBIAN_LATIN_MONTENEGRO, sr-Latn, ME }, { LANGUAGE_SERBIAN_LATIN_BOSNIA_HERZEGOVINA,sr-Latn, BA }, { LANGUAGE_SERBIAN_LATIN_NEUTRAL, sr-Latn,}, +{ LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA, bs-Cyrl, BA }, +{ LANGUAGE_AZERI_CYRILLIC, az-Cyrl, AZ }, // macrolanguage code +{ LANGUAGE_UZBEK_CYRILLIC, uz-Cyrl, UZ }, // macrolanguage code { LANGUAGE_DONTKNOW,, } // marks end of table }; commit 4fe5c3b5cd3425375d7212797dc3d5f7ed14ee2e Author: Eike Rathke er...@redhat.com Date: Thu Sep 12 16:38:52 2013 +0200 set some mbOverrideExists flags Change-Id: Iec408fcdc21357fcbb00cdf08215f0db92a48d3c diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 0de5d5a..da29abf 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -214,7 +214,7 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_BASQUE, eu, , false }, { LANGUAGE_BULGARIAN, bg, BG, false }, { LANGUAGE_CZECH, cs, CZ, false }, -{ LANGUAGE_CZECH, cz, , false }, +{ LANGUAGE_CZECH, cz, , true }, { LANGUAGE_ENGLISH_JAMAICA, en, JM, false }, { LANGUAGE_ENGLISH_CARRIBEAN, en, BS, false }, // not 100%, because AG is Bahamas { LANGUAGE_ENGLISH_BELIZE, en, BZ, false }, @@ -229,11 +229,11 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = { LANGUAGE_GERMAN_LUXEMBOURG, de, LU, false }, { LANGUAGE_GERMAN_LIECHTENSTEIN,de, LI, false }, { LANGUAGE_HEBREW, he, IL, false }, // new: old was iw -{ LANGUAGE_HEBREW, iw, IL, false }, // old: new is he +{ LANGUAGE_HEBREW, iw, IL, true }, // old: new is he { LANGUAGE_HUNGARIAN, hu, HU, false }, { LANGUAGE_ICELANDIC, is, IS, false }, { LANGUAGE_INDONESIAN, id, ID, false }, // new: old was in -{ LANGUAGE_INDONESIAN, in, ID, false }, // old: new is id +{ LANGUAGE_INDONESIAN, in, ID, true }, // old: new is id {
[Libreoffice-commits] core.git: 3 commits - i18nlangtag/source
i18nlangtag/source/isolang/isolang.cxx | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) New commits: commit 1e37bd43a9c9da1de72187a932cd8da60936cc95 Author: Eike Rathke er...@redhat.com Date: Wed Aug 28 12:27:14 2013 +0200 field comments Change-Id: I1df968ff81376b789c34f2c5e56acb6ac0ce30ed diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 8d3e6d2..5e87075 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -560,6 +560,7 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = static IsoLanguageScriptCountryEntry const aImplIsoLangScriptEntries[] = { +// MS-LangID ISO639-ISO15924, ISO3166 // { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, sr-Latn, RS }, // for example, once we support it in l10n; TODO: adapt unit test in this case { LANGUAGE_DONTKNOW,, } // marks end of table }; commit a40afb3f534ea1c655ac728e55a7e4b96b033869 Author: Eike Rathke er...@redhat.com Date: Wed Aug 28 12:19:16 2013 +0200 added IsoLanguageScriptCountryEntry to getDefinedLanguagetags() Change-Id: Icc7cecfca05ceb2b1b75422dd97a6d467b3697f4 diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 8d07617..8d3e6d2 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -560,7 +560,7 @@ static IsoLanguageCountryEntry const aImplIsoLangEntries[] = static IsoLanguageScriptCountryEntry const aImplIsoLangScriptEntries[] = { -// { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, sr-Latn, RS }, // for example, once we support it in l10n +// { LANGUAGE_USER_SERBIAN_LATIN_SERBIA, sr-Latn, RS }, // for example, once we support it in l10n; TODO: adapt unit test in this case { LANGUAGE_DONTKNOW,, } // marks end of table }; @@ -1116,7 +1116,13 @@ LanguageType MsLangId::convertUnxByteStringToLanguage( ::std::vector MsLangId::LanguagetagMapping MsLangId::getDefinedLanguagetags() { ::std::vector LanguagetagMapping aVec; -for (const IsoLanguageCountryEntry* pEntry = aImplIsoLangEntries; pEntry-mnLang != LANGUAGE_DONTKNOW; ++pEntry) +for (const IsoLanguageScriptCountryEntry* pEntry = aImplIsoLangScriptEntries; +pEntry-mnLang != LANGUAGE_DONTKNOW; ++pEntry) +{ +aVec.push_back( LanguagetagMapping( pEntry-getTagString(), pEntry-mnLang)); +} +for (const IsoLanguageCountryEntry* pEntry = aImplIsoLangEntries; +pEntry-mnLang != LANGUAGE_DONTKNOW; ++pEntry) { aVec.push_back( LanguagetagMapping( pEntry-getTagString(), pEntry-mnLang)); } commit 55503ad64689928e6c0c28a34e72a4dd3a3fa438 Author: Eike Rathke er...@redhat.com Date: Wed Aug 28 12:14:32 2013 +0200 don't use startsWithIgnoreAsciiCase() on pointers Change-Id: I407e4769be254446ad191ce7640ea1789bca1f1e diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx index 41d8411..8d07617 100644 --- a/i18nlangtag/source/isolang/isolang.cxx +++ b/i18nlangtag/source/isolang/isolang.cxx @@ -53,6 +53,12 @@ struct IsoLanguageScriptCountryEntry /** Obtain a locale. */ ::com::sun::star::lang::Locale getLocale() const; + +/** If rStr starts with maLanguageScript ignoring case. + +We don't have OUString::startsWithIgnoreAsciiCaseAscii() + */ +bool startsInIgnoreAsciiCase( const OUString rStr ) const; }; struct IsoLangEngEntry @@ -587,6 +593,11 @@ OUString IsoLanguageScriptCountryEntry::getTagString() const return lang::Locale( I18NLANGTAG_QLT, OUString::createFromAscii( maCountry), getTagString()); } +bool IsoLanguageScriptCountryEntry::startsInIgnoreAsciiCase( const OUString rStr ) const +{ +return rStr.matchIgnoreAsciiCaseAsciiL( maLanguageScript, strlen( maLanguageScript), 0); +} + // --- // In this table are the countries which should mapped to a specific @@ -773,7 +784,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang, for (const IsoLanguageScriptCountryEntry* pScriptEntry = aImplIsoLangScriptEntries; pScriptEntry-mnLang != LANGUAGE_DONTKNOW; ++pScriptEntry) { -if (rLocale.Variant.startsWithIgnoreAsciiCase( pScriptEntry-maLanguageScript)) +if (pScriptEntry-startsInIgnoreAsciiCase( rLocale.Variant)) { if (rLocale.Variant.equalsIgnoreAsciiCase( pScriptEntry-getTagString())) return pScriptEntry-getLocale(); @@ -792,7 +803,7 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang, for (const IsoLanguageScriptCountryEntry* pScriptEntry = pFirstScript; pScriptEntry-mnLang != LANGUAGE_DONTKNOW;
[Libreoffice-commits] core.git: 3 commits - i18nlangtag/source include/unotools unotools/source vcl/source
i18nlangtag/source/languagetag/languagetag.cxx |9 +- include/unotools/fontcfg.hxx | 49 ++-- unotools/source/config/fontcfg.cxx | 96 + vcl/source/app/settings.cxx|2 vcl/source/gdi/outdev3.cxx | 31 +++- vcl/source/window/window.cxx |2 6 files changed, 79 insertions(+), 110 deletions(-) New commits: commit f66f896657967c0ce3c75680e956cad918a632d3 Author: Eike Rathke er...@redhat.com Date: Fri Jul 12 00:08:32 2013 +0200 DefaultFontConfiguration and FontSubstConfiguration with LanguageTag Change-Id: I6c111392537d114358d0574f2dbdf40f684b5103 diff --git a/include/unotools/fontcfg.hxx b/include/unotools/fontcfg.hxx index 5e63ddb..e33397f 100644 --- a/include/unotools/fontcfg.hxx +++ b/include/unotools/fontcfg.hxx @@ -19,6 +19,7 @@ #ifndef _UNOTOOLS_FONTCFG_HXX #define _UNOTOOLS_FONTCFG_HXX +#include i18nlangtag/languagetag.hxx #include unotools/unotoolsdllapi.h #include tools/solar.h #include tools/fontenum.hxx @@ -59,8 +60,8 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration static DefaultFontConfiguration get(); -OUString getDefaultFont( const com::sun::star::lang::Locale rLocale, int nType ) const; -OUString getUserInterfaceFont( const com::sun::star::lang::Locale rLocale ) const; +OUString getDefaultFont( const LanguageTag rLanguageTag, int nType ) const; +OUString getUserInterfaceFont( const LanguageTag rLanguageTag ) const; }; // IMPL_FONT_ATTR_DEFAULT - Default-Font like Andale Sans UI, Palace Script, Albany, Thorndale, Cumberland, ... @@ -175,10 +176,7 @@ public: const FontNameAttr* getSubstInfo( const OUString rFontName, - const com::sun::star::lang::Locale rLocale = - com::sun::star::lang::Locale( OUString( en ), - OUString(), - OUString() ) + const LanguageTag rLanguageTag = LanguageTag( OUString( en)) ) const; static void getMapName( const OUString rOrgName, OUString rShortName, OUString rFamilyName, FontWeight rWeight, FontWidth rWidth, sal_uLong rType ); }; diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index b61de13..3edd9b4 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -209,24 +209,23 @@ OUString DefaultFontConfiguration::tryLocale( const OUString rBcp47, const OUSt return aRet; } -OUString DefaultFontConfiguration::getDefaultFont( const Locale rLocale, int nType ) const +OUString DefaultFontConfiguration::getDefaultFont( const LanguageTag rLanguageTag, int nType ) const { OUString aType = OUString::createFromAscii( getKeyType( nType ) ); -LanguageTag aLanguageTag( rLocale); // Try the simple cases first without constructing fallbacks. -OUString aRet = tryLocale( aLanguageTag.getBcp47(), aType ); +OUString aRet = tryLocale( rLanguageTag.getBcp47(), aType ); if (aRet.isEmpty()) { -if (rLocale.Variant.isEmpty()) +if (rLanguageTag.isIsoLocale()) { -if (!rLocale.Country.isEmpty()) +if (!rLanguageTag.getCountry().isEmpty()) { -aRet = tryLocale( rLocale.Language, aType ); +aRet = tryLocale( rLanguageTag.getLanguage(), aType ); } } else { -::std::vector OUString aFallbacks( aLanguageTag.getFallbackStrings()); +::std::vector OUString aFallbacks( rLanguageTag.getFallbackStrings()); aFallbacks.erase( aFallbacks.begin()); // first is full BCP47, we already checked that for (::std::vector OUString ::const_iterator it( aFallbacks.begin()); it != aFallbacks.end() aRet.isEmpty(); ++it) @@ -242,13 +241,13 @@ OUString DefaultFontConfiguration::getDefaultFont( const Locale rLocale, int nT return aRet; } -OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale rLocale ) const +OUString DefaultFontConfiguration::getUserInterfaceFont( const LanguageTag rLanguageTag ) const { -Locale aLocale = rLocale; -if( aLocale.Language.isEmpty() ) -aLocale = SvtSysLocale().GetUILanguageTag().getLocale(); +LanguageTag aLanguageTag( rLanguageTag); +if( aLanguageTag.isSystemLocale() ) +aLanguageTag = SvtSysLocale().GetUILanguageTag(); -OUString aUIFont = getDefaultFont( aLocale, DEFAULTFONT_UI_SANS ); +OUString aUIFont = getDefaultFont( aLanguageTag, DEFAULTFONT_UI_SANS ); if( !aUIFont.isEmpty() ) return aUIFont; @@ -265,16 +264,18 @@ OUString