summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-04 15:04:04 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-12-04 15:06:17 +0000
commit1ded21bfb99951ca947bd11a7442398668202ca6 (patch)
treea201aae9f7de718802ee84ff11a3547ab3edc46e
parent4bad16b2a27ba44998b107cb3cc5fdca92753ccf (diff)
Resolves: rhbz#912529 Kerkis SmallCaps shown instead of Kerkis Regular
we encounter both fonts, but all their properties that we compare are the same, so we think they are two versions of the same font and throw away the "Regular" version. Change-Id: I24369f10c7a0edba1faa02621bb78616e880966e
-rw-r--r--vcl/source/gdi/outdev3.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index c27cd9353aa4..f3f5a77f28df 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -665,7 +665,7 @@ PhysicalFontFace::PhysicalFontFace( const ImplDevFontAttributes& rDFA, int nMagi
sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther ) const
{
- // compare their width, weight, italic and style name
+ // compare their width, weight, italic, style name and family name
if( GetWidthType() < rOther.GetWidthType() )
return -1;
else if( GetWidthType() > rOther.GetWidthType() )
@@ -681,7 +681,14 @@ sal_Int32 PhysicalFontFace::CompareIgnoreSize( const PhysicalFontFace& rOther )
else if( GetSlant() > rOther.GetSlant() )
return 1;
- return GetFamilyName().compareTo( rOther.GetFamilyName() );
+ sal_Int32 nRet = GetFamilyName().compareTo( rOther.GetFamilyName() );
+
+ if (nRet == 0)
+ {
+ nRet = GetStyleName().compareTo( rOther.GetStyleName() );
+ }
+
+ return nRet;
}
sal_Int32 PhysicalFontFace::CompareWithSize( const PhysicalFontFace& rOther ) const