summaryrefslogtreecommitdiff
path: root/vcl/generic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-19 13:48:45 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-19 14:11:50 +0100
commitd9e4c74811855de15f1bf2045c2c9b061a2d4dc6 (patch)
tree895cbcd595094e9fd2621a943fc83bb004b429c9 /vcl/generic
parent2a598619d7fbc992f1903a745fd536ddf5e45c81 (diff)
merge together hand-crafted traditional/simplified chinese tests
merge together a gadzillion hand-crafted isSimpleChinese/isTraditionalChinese/isKoreanVariants/isCJK implementations which should fix a goodly amount of them add a MsLangId::isFamilyNameFirst for locales where family name appears first while I'm at it. Change-Id: I65377793be037d16fe7250cd7450b28aec689e83
Diffstat (limited to 'vcl/generic')
-rw-r--r--vcl/generic/glyphs/gcach_ftyp.cxx23
-rw-r--r--vcl/generic/print/genpspgraphics.cxx46
2 files changed, 26 insertions, 43 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 7c4bc21202bb..9cd88a47c3ab 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -50,6 +50,7 @@
#include "osl/file.hxx"
#include "osl/thread.hxx"
+#include "langboost.hxx"
#include "sft.hxx"
#include <ft2build.h>
@@ -177,27 +178,7 @@ FtFontFile::FtFontFile( const ::rtl::OString& rNativeFileName )
if( bOnce )
{
bOnce = false;
- LanguageType aLang = Application::GetSettings().GetUILanguage();
- switch( aLang )
- {
- case LANGUAGE_JAPANESE:
- pLangBoost = "jan";
- break;
- case LANGUAGE_CHINESE:
- case LANGUAGE_CHINESE_SIMPLIFIED:
- case LANGUAGE_CHINESE_SINGAPORE:
- pLangBoost = "zhs";
- break;
- case LANGUAGE_CHINESE_TRADITIONAL:
- case LANGUAGE_CHINESE_HONGKONG:
- case LANGUAGE_CHINESE_MACAU:
- pLangBoost = "zht";
- break;
- case LANGUAGE_KOREAN:
- case LANGUAGE_KOREAN_JOHAB:
- pLangBoost = "kor";
- break;
- }
+ pLangBoost = vcl::getLangBoost();
}
if( pLangBoost && !strncasecmp( pLangBoost, &maNativeFileName.getStr()[nPos+1], 3 ) )
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index 29c0610c53d1..95aed990e218 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -54,13 +54,15 @@
#include "fontsubset.hxx"
#include "salprn.hxx"
#include "region.h"
+#include "langboost.hxx"
#ifdef ENABLE_GRAPHITE
#include <graphite_layout.hxx>
#include <graphite_serverfont.hxx>
#endif
-#include "comphelper/string.hxx"
+#include <comphelper/string.hxx>
+#include <i18npool/mslangid.hxx>
using namespace psp;
@@ -1178,6 +1180,26 @@ ImplDevFontAttributes GenPspGraphics::Info2DevFontAttributes( const psp::FastPri
return aDFA;
}
+namespace vcl
+{
+ const char* getLangBoost()
+ {
+ const char* pLangBoost;
+ const LanguageType eLang = Application::GetSettings().GetUILanguage();
+ if (eLang == LANGUAGE_JAPANESE)
+ pLangBoost = "jan";
+ else if (MsLangId::isKorean(eLang))
+ pLangBoost = "kor";
+ else if (MsLangId::isSimplifiedChinese(eLang))
+ pLangBoost = "zhs";
+ else if (MsLangId::isTraditionalChinese(eLang))
+ pLangBoost = "zht";
+ else
+ pLangBoost = NULL;
+ return pLangBoost;
+ }
+}
+
// -----------------------------------------------------------------------
void GenPspGraphics::AnnounceFonts( ImplDevFontList* pFontList, const psp::FastPrintFontInfo& aInfo )
@@ -1199,27 +1221,7 @@ void GenPspGraphics::AnnounceFonts( ImplDevFontList* pFontList, const psp::FastP
if( bOnce )
{
bOnce = false;
- const LanguageType aLang = Application::GetSettings().GetUILanguage();
- switch( aLang )
- {
- case LANGUAGE_JAPANESE:
- pLangBoost = "jan";
- break;
- case LANGUAGE_CHINESE:
- case LANGUAGE_CHINESE_SIMPLIFIED:
- case LANGUAGE_CHINESE_SINGAPORE:
- pLangBoost = "zhs";
- break;
- case LANGUAGE_CHINESE_TRADITIONAL:
- case LANGUAGE_CHINESE_HONGKONG:
- case LANGUAGE_CHINESE_MACAU:
- pLangBoost = "zht";
- break;
- case LANGUAGE_KOREAN:
- case LANGUAGE_KOREAN_JOHAB:
- pLangBoost = "kor";
- break;
- }
+ pLangBoost = vcl::getLangBoost();
}
if( pLangBoost )