summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-09-17 11:26:03 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-09-17 11:26:03 +0000
commite6c689f43a50e1dbda83f88ae1e0e43689cbe0c7 (patch)
tree5943c0ad2a66bc87f52d60be5c4db943645898b6 /linguistic
parent53affd64ef90f1ca772701f051d347dc89d11491 (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.cxx18
-rw-r--r--linguistic/source/lngopt.hxx2
2 files changed, 11 insertions, 9 deletions
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index bb750b2eb7..fc6f4c7cc3 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 d983088265..2188ef4d88 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();