diff options
Diffstat (limited to 'desktop/source/deployment/misc/dp_resource.cxx')
-rw-r--r-- | desktop/source/deployment/misc/dp_resource.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx index ddf50090e99b..eb92eabba38d 100644 --- a/desktop/source/deployment/misc/dp_resource.cxx +++ b/desktop/source/deployment/misc/dp_resource.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -105,7 +105,7 @@ void checkPrimarySubtag(::rtl::OUString const & tag) if (len < 1 || len > 3) throw Exception(OUSTR("Invalid language string."), 0); - if (len == 1 + if (len == 1 && (arLang[0] != 'i' && arLang[0] != 'x')) throw Exception(OUSTR("Invalid language string."), 0); @@ -132,7 +132,7 @@ void checkSecondSubtag(::rtl::OUString const & tag, bool & bIsCountry) throw Exception(OUSTR("Invalid language string."), 0); //country code bIsCountry = false; - if (len == 2) + if (len == 2) { for (sal_Int32 i = 0; i < 2; i++) { @@ -150,7 +150,7 @@ void checkSecondSubtag(::rtl::OUString const & tag, bool & bIsCountry) for (sal_Int32 i = 0; i < len; i++) { if (!( (arLang[i] >= 'A' && arLang[i] <= 'Z') - || (arLang[i] >= 'a' && arLang[i] <= 'z') + || (arLang[i] >= 'a' && arLang[i] <= 'z') || (arLang[i] >= '0' && arLang[i] <= '9') )) { throw Exception(OUSTR("Invalid language string."), 0); @@ -164,12 +164,12 @@ void checkThirdSubtag(::rtl::OUString const & tag) sal_Int32 len = tag.getLength(); sal_Unicode const * arLang = tag.getStr(); if (len < 1 || len > 8) - throw Exception(OUSTR("Invalid language string."), 0); + throw Exception(OUSTR("Invalid language string."), 0); for (sal_Int32 i = 0; i < len; i++) { if (!( (arLang[i] >= 'A' && arLang[i] <= 'Z') - || (arLang[i] >= 'a' && arLang[i] <= 'z') + || (arLang[i] >= 'a' && arLang[i] <= 'z') || (arLang[i] >= '0' && arLang[i] <= '9') )) { throw Exception(OUSTR("Invalid language string."), 0); @@ -181,7 +181,7 @@ void checkThirdSubtag(::rtl::OUString const & tag) //We parse the string acording to RFC 3066 //We only use the primary sub-tag and two subtags. That is lang-country-variant -//We do some simple tests if the string is correct. Actually this should do a +//We do some simple tests if the string is correct. Actually this should do a //validating parser //We may have the case that there is no country tag, for example en-welsh ::com::sun::star::lang::Locale toLocale( ::rtl::OUString const & slang ) @@ -215,7 +215,7 @@ void checkThirdSubtag(::rtl::OUString const & tag) locale.Variant = variant; } } - + return locale; } |