From 0d06f4722ada7a5ab4f4ca041473c119c6739771 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Jan 23 2012 11:36:37 +0000 Subject: Resolves: fdo#44078 fix font alias name problems --- diff --git a/0001-Resolves-fdo-44078-fix-unfortunate-name-alias-mixups.patch b/0001-Resolves-fdo-44078-fix-unfortunate-name-alias-mixups.patch new file mode 100644 index 0000000..23bb456 --- /dev/null +++ b/0001-Resolves-fdo-44078-fix-unfortunate-name-alias-mixups.patch @@ -0,0 +1,74 @@ +From 25b90909a7a22f6900abbe9df12570a24e528c9a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 11 Jan 2012 20:47:54 +0000 +Subject: [PATCH] Resolves:fdo#44078 fix unfortunate name alias mixups with + DejaVu fonts + +--- + vcl/generic/fontmanager/fontconfig.cxx | 19 +++++++++++++++---- + 1 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx +index 4d02a76..a120fb7 100644 +--- a/vcl/generic/fontmanager/fontconfig.cxx ++++ b/vcl/generic/fontmanager/fontconfig.cxx +@@ -124,7 +124,7 @@ public: + boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aFontNameToLocalized; + boost::unordered_map< rtl::OString, rtl::OString, rtl::OStringHash > m_aLocalizedToCanonical; + private: +- void cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements); ++ void cacheLocalizedFontNames(const FcChar8 *origfontname, const FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements); + }; + + FontCfgWrapper::FontCfgWrapper() +@@ -296,6 +296,7 @@ namespace + + std::vector::const_iterator aEnd = elements.end(); + bool alreadyclosematch = false; ++ bool found_fallback_englishname = false; + for( std::vector::const_iterator aIter = elements.begin(); aIter != aEnd; ++aIter ) + { + const char *pLang = (const char*)aIter->first; +@@ -307,7 +308,8 @@ namespace + } + else if( alreadyclosematch ) + { +- // override candidate only if there is a perfect match ++ // current candidate matches lang of lang-TERRITORY ++ // override candidate only if there is a full match + continue; + } + else if( rtl_str_compare( pLang, sLangMatch.getStr()) == 0) +@@ -316,10 +318,18 @@ namespace + candidate = aIter->second; + alreadyclosematch = true; + } ++ else if( found_fallback_englishname ) ++ { ++ // already found an english fallback, don't override candidate ++ // unless there is a better language match ++ continue; ++ } + else if( rtl_str_compare( pLang, "en") == 0) + { +- // fallback to the english element name ++ // select a fallback candidate of the first english element ++ // name + candidate = aIter->second; ++ found_fallback_englishname = true; + } + } + return candidate; +@@ -327,7 +337,8 @@ namespace + } + + //Set up maps to quickly map between a fonts best UI name and all the rest of its names, and vice versa +-void FontCfgWrapper::cacheLocalizedFontNames(FcChar8 *origfontname, FcChar8 *bestfontname, const std::vector< lang_and_element > &lang_and_elements) ++void FontCfgWrapper::cacheLocalizedFontNames(const FcChar8 *origfontname, const FcChar8 *bestfontname, ++ const std::vector< lang_and_element > &lang_and_elements) + { + std::vector::const_iterator aEnd = lang_and_elements.end(); + for (std::vector::const_iterator aIter = lang_and_elements.begin(); aIter != aEnd; ++aIter) +-- +1.7.6.5 + diff --git a/libreoffice.spec b/libreoffice.spec index f386f81..04a5cc1 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -159,6 +159,7 @@ Patch41: libreoffice-rhel6langs.patch %endif Patch42: solenv.fix.mk.inheritance.patch Patch43: 0001-Related-rhbz-753201-fedora-ant-java-1.5.0-gcj-won-t-.patch +Patch44: 0001-Resolves-fdo-44078-fix-unfortunate-name-alias-mixups.patch %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %define instdir %{_libdir} @@ -982,6 +983,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc %endif %patch42 -p1 -b .solenv.fix.mk.inheritance.patch %patch43 -p1 -b .rhbz-753201-fedora-ant-java-1.5.0-gcj-won-t-.patch +%patch44 -p1 -b .fdo44078-fix-unfortunate-name-alias-mixups.patch # these are horribly incomplete--empty translations and copied english # strings with spattering of translated strings @@ -2302,6 +2304,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : libreoffice-langpack-de - Resolves: rhbz#661738 Very slow java database operations: Attach/DetachCurrentThread +- Resolves: fdo#44078 fix font alias name problems * Fri Jan 06 2012 Caolán McNamara - 3.4.4.2-7 - Resolves: fdo#40482 Writer view options destroyed by printing