[Libreoffice-commits] .: vcl/generic

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 13 04:47:57 PST 2012


 vcl/generic/fontmanager/fontconfig.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 4afc70d295399e9e978053c2ae7d2fe29371abd5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Nov 13 12:46:16 2012 +0000

    fontconfig < 2.4.92 doesn't have FcGetLangs, fallback to old logic in absence
    
    Change-Id: Ie789bdfbf26c9cf652d43d6badfad6fec1a3eb9e

diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index 8820d2d..8270585 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -798,6 +798,7 @@ namespace
     //In the meantime try something that will fit to workaround fdo#35118
     OString mapToFontConfigLangTag(const LanguageTag &rLangTag)
     {
+#if defined(FC_VERSION) && (FC_VERSION >= 20492)
         FcStrSet *pLangSet = FcGetLangs();
         OString sLangAttrib;
 
@@ -823,6 +824,12 @@ namespace
             return sLang;
 
         return OString();
+#else
+        OString sLangAttrib = OUStringToOString(rLangTag.getLanguageAndScript(), RTL_TEXTENCODING_UTF8).toAsciiLowerCase();
+        if (sLangAttrib.equalsIgnoreAsciiCase("pa-in"))
+            sLangAttrib = "pa";
+        return sLangAttrib;
+#endif
     }
 
 #if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)


More information about the Libreoffice-commits mailing list