diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-09-17 11:26:03 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-09-17 11:26:03 +0000 |
commit | 79a0747e1d7bd867e5cad9ce76fd98669489c9db (patch) | |
tree | e28daf01db34250b67d4057cf630f4ee1e52203d /linguistic | |
parent | 762181f6f1168e0eb54009990222d7cb4cebebd5 (diff) |
CWS-TOOLING: integrate CWS defaultdoclang
2009-08-21 14:44:21 +0200 cmc r275260 : CWS-TOOLING: rebase CWS defaultdoclang to trunk@275001 (milestone: DEV300:m55)
2009-08-10 17:43:32 +0200 cmc r274833 : CWS-TOOLING: rebase CWS defaultdoclang to trunk@274622 (milestone: DEV300:m54)
2009-07-24 11:46:58 +0200 cmc r274297 : CWS-TOOLING: rebase CWS defaultdoclang to trunk@274203 (milestone: DEV300:m53)
2009-07-10 12:22:16 +0200 cmc r273884 : #i99577# tweak the widths a bit
2009-07-08 15:17:58 +0200 cmc r273834 : #i99577 tidy up indentation
2009-07-04 16:09:18 +0200 cmc r273721 : #i99577# a "default" document language that reflects what the locale language is
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/lngopt.cxx | 18 | ||||
-rw-r--r-- | linguistic/source/lngopt.hxx | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index bd2473528d81..995b0686e2f8 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -46,7 +46,9 @@ #include <com/sun/star/registry/XSimpleRegistry.hpp> #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/lang/Locale.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <unotools/processfactory.hxx> +#include <i18npool/mslangid.hxx> using namespace utl; using namespace osl; @@ -100,13 +102,13 @@ LinguOptions::~LinguOptions() } -BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal) +BOOL LinguOptions::SetLocale_Impl( INT16 &rLanguage, Any &rOld, const Any &rVal, sal_Int16 nType) { BOOL bRes = FALSE; Locale aNew; rVal >>= aNew; - INT16 nNew = LocaleToLanguage( aNew ); + INT16 nNew = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aNew), nType); if (nNew != rLanguage) { Locale aLocale( CreateLocale( rLanguage ) ); @@ -149,17 +151,17 @@ BOOL LinguOptions::SetValue( Any &rOld, const Any &rVal, INT32 nWID ) case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; case WID_DEFAULT_LOCALE : { - bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal ); + bRes = SetLocale_Impl( pData->nDefaultLanguage, rOld, rVal, ::com::sun::star::i18n::ScriptType::LATIN ); break; } case WID_DEFAULT_LOCALE_CJK : { - bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal ); + bRes = SetLocale_Impl( pData->nDefaultLanguage_CJK, rOld, rVal, ::com::sun::star::i18n::ScriptType::ASIAN ); break; } case WID_DEFAULT_LOCALE_CTL : { - bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal ); + bRes = SetLocale_Impl( pData->nDefaultLanguage_CTL, rOld, rVal, ::com::sun::star::i18n::ScriptType::COMPLEX ); break; } default : @@ -227,19 +229,19 @@ void LinguOptions::GetValue( Any &rVal, INT32 nWID ) const case WID_HYPH_MIN_WORD_LENGTH : pnVal = &pData->nHyphMinWordLength; break; case WID_DEFAULT_LOCALE : { - Locale aLocale( CreateLocale( pData->nDefaultLanguage ) ); + Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage ) ); rVal.setValue( &aLocale, ::getCppuType((Locale*)0 )); break; } case WID_DEFAULT_LOCALE_CJK : { - Locale aLocale( CreateLocale( pData->nDefaultLanguage_CJK ) ); + Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CJK ) ); rVal.setValue( &aLocale, ::getCppuType((Locale*)0 )); break; } case WID_DEFAULT_LOCALE_CTL : { - Locale aLocale( CreateLocale( pData->nDefaultLanguage_CTL ) ); + Locale aLocale( MsLangId::convertLanguageToLocale( pData->nDefaultLanguage_CTL ) ); rVal.setValue( &aLocale, ::getCppuType((Locale*)0 )); break; } diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index 3a92baa32faf..b424970a929b 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -77,7 +77,7 @@ class LinguOptions BOOL SetLocale_Impl( INT16 &rLanguage, ::com::sun::star::uno::Any &rOld, - const ::com::sun::star::uno::Any &rVal); + const ::com::sun::star::uno::Any &rVal, sal_Int16 nType ); public: LinguOptions(); |