[Libreoffice-commits] .: 3 commits - filter/source vcl/unx
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Oct 19 08:04:40 PDT 2011
filter/source/config/cache/filtercache.cxx | 26 ++++++++++++++------------
vcl/unx/generic/gdi/salgdi3.cxx | 21 +++++----------------
2 files changed, 19 insertions(+), 28 deletions(-)
New commits:
commit 3f9a28f1f704967446b411b3b7e176deeb78ca83
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Oct 19 16:03:29 2011 +0100
Resolves: fdo#41556 font sub cache of nameA => nameB is too simplistic
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 4d21f5d..b0f59cd 100755
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -3304,7 +3304,6 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
{
// initialize the members provided by the font request
mnWidth = rFontSelData.mnWidth;
- mnSlant = rFontSelData.GetSlant();
mnOrientation = sal::static_int_cast<short>(rFontSelData.mnOrientation);
// intialize the used font name
@@ -3329,6 +3328,7 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
mnDescent = 0;
mnIntLeading = 0;
mnExtLeading = 0;
+ mnSlant = 0;
mnMinKashida = 0;
// reset metrics that are usually derived from the measurements
diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx
index 7c94d40..0ced020 100644
--- a/vcl/unx/generic/gdi/salgdi3.cxx
+++ b/vcl/unx/generic/gdi/salgdi3.cxx
@@ -847,11 +847,6 @@ class FcPreMatchSubstititution
{
public:
bool FindFontSubstitute( ImplFontSelectData& ) const;
-
-private:
- typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash >
- CachedFontMapType;
- mutable CachedFontMapType maCachedFontMap;
};
class FcGlyphFallbackSubstititution
@@ -945,20 +940,14 @@ bool FcPreMatchSubstititution::FindFontSubstitute( ImplFontSelectData &rFontSelD
|| 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) )
return false;
- CachedFontMapType::const_iterator itr = maCachedFontMap.find(rFontSelData.maTargetName);
- if (itr != maCachedFontMap.end())
- {
- // Cached substitution pair
- rFontSelData.maSearchName = itr->second;
- return true;
- }
-
+ //Note: see fdo#41556 if you feel compelled to cache the results here,
+ //remember that fontconfig can return e.g. an italic font for a non-italic
+ //input and/or different fonts depending on fontsize, bold, etc settings so
+ //don't cache just on the name, cache on all the input and be don't just
+ //return the original selection data with the fontname updated
rtl::OUString aDummy;
const ImplFontSelectData aOut = GetFcSubstitute( rFontSelData, aDummy );
- maCachedFontMap.insert(
- CachedFontMapType::value_type(rFontSelData.maTargetName, aOut.maSearchName));
-
if( !aOut.maSearchName.Len() )
return false;
commit 4ea86b46768c8309a7c259f713fd6d3c8d7abc28
Author: Maxim Iorsh <iorsh at users.sourceforge.net>
Date: Wed Oct 19 12:40:04 2011 +0100
Resolves: fdo#41556 When fontconfig matches italic font, italicity is ignored
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index b0f59cd..4d21f5d 100755
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -3304,6 +3304,7 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
{
// initialize the members provided by the font request
mnWidth = rFontSelData.mnWidth;
+ mnSlant = rFontSelData.GetSlant();
mnOrientation = sal::static_int_cast<short>(rFontSelData.mnOrientation);
// intialize the used font name
@@ -3328,7 +3329,6 @@ ImplFontMetricData::ImplFontMetricData( const ImplFontSelectData& rFontSelData )
mnDescent = 0;
mnIntLeading = 0;
mnExtLeading = 0;
- mnSlant = 0;
mnMinKashida = 0;
// reset metrics that are usually derived from the measurements
commit 5e8c0dd410942807481a75a29805db40b8659a4e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 18 14:32:05 2011 +0100
don't annoy me in the en-US fallback case
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index 5099cc9..9d0a885 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -1691,18 +1691,20 @@ void FilterCache::impl_readPatchUINames(const css::uno::Reference< css::containe
pLocale = ::comphelper::Locale::getFallback(lLocales, sActLocale);
if (pLocale == lLocales.end())
{
- #if OSL_DEBUG_LEVEL > 0
- ::rtl::OUString sName = rItem.getUnpackedValueOrDefault(PROPNAME_NAME, ::rtl::OUString());
-
- ::rtl::OUStringBuffer sMsg(256);
- sMsg.appendAscii("Fallback scenario for filter or type '" );
- sMsg.append (sName );
- sMsg.appendAscii("' and locale '" );
- sMsg.append (sActLocale );
- sMsg.appendAscii("' failed. Please check your filter configuration.");
-
- OSL_FAIL(_FILTER_CONFIG_TO_ASCII_(sMsg.makeStringAndClear()));
- #endif
+#if OSL_DEBUG_LEVEL > 0
+ if (sActLocale.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("en-US")))
+ return;
+ ::rtl::OUString sName = rItem.getUnpackedValueOrDefault(PROPNAME_NAME, ::rtl::OUString());
+
+ ::rtl::OUStringBuffer sMsg(256);
+ sMsg.appendAscii("Fallback scenario for filter or type '" );
+ sMsg.append (sName );
+ sMsg.appendAscii("' and locale '" );
+ sMsg.append (sActLocale );
+ sMsg.appendAscii("' failed. Please check your filter configuration.");
+
+ OSL_FAIL(_FILTER_CONFIG_TO_ASCII_(sMsg.makeStringAndClear()));
+#endif
return;
}
More information about the Libreoffice-commits
mailing list