From 87f6d77a00006f49cb32a8b0e43d0dcd542cb567 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Thu, 17 Sep 2009 11:26:03 +0000 Subject: 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 --- chart2/source/tools/CharacterProperties.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'chart2') diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index e9893bae0a89..4f558b35df0a 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -51,9 +51,11 @@ #include #include #include +#include #include + // header for struct SvtLinguConfig #ifndef _SVTOOLS_LINGUCFG_HXX_ #include @@ -478,16 +480,21 @@ void CharacterProperties::AddDefaultsToMap( const float fDefaultFontHeight = 13.0; SvtLinguConfig aLinguConfig; - lang::Locale aDefaultLocale( C2U( "en" ), C2U( "US" ), OUString() ); + lang::Locale aDefaultLocale; aLinguConfig.GetProperty(C2U("DefaultLocale")) >>= aDefaultLocale; lang::Locale aDefaultLocale_CJK; aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")) >>= aDefaultLocale_CJK; lang::Locale aDefaultLocale_CTL; aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")) >>= aDefaultLocale_CTL; - Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale ), DEFAULTFONT_FLAGS_ONLYONE, 0 ); - Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK ), DEFAULTFONT_FLAGS_ONLYONE, 0 ); - Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL ), DEFAULTFONT_FLAGS_ONLYONE, 0 ); + using namespace ::com::sun::star::i18n::ScriptType; + LanguageType nLang; + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aDefaultLocale), LATIN); + Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK), ASIAN); + Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); + nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL), COMPLEX); + Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) ); -- cgit