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 | 87f6d77a00006f49cb32a8b0e43d0dcd542cb567 (patch) | |
tree | b129868de28660b518f403ccc62cf5361079c384 /chart2 | |
parent | f06e2089d82702cbc577cd3358260d98cc790131 (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 'chart2')
-rw-r--r-- | chart2/source/tools/CharacterProperties.cxx | 15 |
1 files changed, 11 insertions, 4 deletions
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 <com/sun/star/text/RubyAdjust.hpp> #include <com/sun/star/awt/FontStrikeout.hpp> #include <com/sun/star/text/WritingMode2.hpp> +#include <com/sun/star/i18n/ScriptType.hpp> #include <comphelper/InlineContainer.hxx> + // header for struct SvtLinguConfig #ifndef _SVTOOLS_LINGUCFG_HXX_ #include <svtools/lingucfg.hxx> @@ -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()) ); |