summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-20 16:54:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-21 11:30:32 +0200
commite0ad66c833265e16ef515283e998ed17f7c9e7f4 (patch)
treefd853bfbb644319ec0e96fa44b80a83b0372e0e7
parent195c1cfb16a9513e496c2bc2179c282344df9926 (diff)
drop unnecessary mpFontInstance use path
the only call to the ImplFontMetricData ctor is from the ctor of LogicalFontInstance. LogicalFontInstance is only created via PhysicalFontFace::CreateFontInstance which is only from ImplFontCache::GetFontInstance. The typical call to ImplFontCache::GetFontInstance(..., FontSelectPattern&) is from the other GetFontInstance which create a new FontSelectPatternAttributes so rFontSelData.mpFontInstance won't get set in that case The other case is from the edge-case GetGlyphFallbackFont where mpFontInstance will be set. I'm reasonably confident that we don't need actually have this mpFontInstance use, but if it turns out we do then it could be restored to GetGlyphFallbackFont after it ctors the its LogicalFontInstance return Change-Id: I77404876b55bceced951d78cb52bc9cb829fc904 Reviewed-on: https://gerrit.libreoffice.org/59371 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/inc/impfontmetricdata.hxx4
-rw-r--r--vcl/source/font/fontmetric.cxx17
2 files changed, 6 insertions, 15 deletions
diff --git a/vcl/inc/impfontmetricdata.hxx b/vcl/inc/impfontmetricdata.hxx
index 28e0ab3798a2..f11b763be126 100644
--- a/vcl/inc/impfontmetricdata.hxx
+++ b/vcl/inc/impfontmetricdata.hxx
@@ -31,12 +31,12 @@ class ImplFontMetricData;
typedef tools::SvRef<ImplFontMetricData> ImplFontMetricDataRef;
class OutputDevice;
-class FontSelectPattern;
+class FontSelectPatternAttributes;
class VCL_DLLPUBLIC ImplFontMetricData : public FontAttributes, public SvRefBase
{
public:
- explicit ImplFontMetricData( const FontSelectPattern& );
+ explicit ImplFontMetricData( const FontSelectPatternAttributes& );
// font instance attributes from the font request
long GetWidth() const { return mnWidth; }
diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index e6b507b161a6..d2d6e3a5d210 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -191,7 +191,7 @@ bool ImplFontMetric::operator==( const ImplFontMetric& r ) const
return true;
}
-ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
+ImplFontMetricData::ImplFontMetricData( const FontSelectPatternAttributes& rFontSelData )
: FontAttributes( rFontSelData )
, mnHeight ( rFontSelData.mnHeight )
, mnWidth ( rFontSelData.mnWidth )
@@ -231,20 +231,11 @@ ImplFontMetricData::ImplFontMetricData( const FontSelectPattern& rFontSelData )
, mnDStrikeoutOffset2( 0 )
{
// initialize the used font name
- if (rFontSelData.mpFontInstance)
- {
- SetFamilyName(rFontSelData.mpFontInstance->GetFontFace()->GetFamilyName());
- SetStyleName(rFontSelData.mpFontInstance->GetFontFace()->GetStyleName());
- }
- else
- {
- sal_Int32 nTokenPos = 0;
- SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) );
- SetStyleName( rFontSelData.GetStyleName() );
- }
+ sal_Int32 nTokenPos = 0;
+ SetFamilyName( GetNextFontToken( rFontSelData.GetFamilyName(), nTokenPos ) );
+ SetStyleName( rFontSelData.GetStyleName() );
}
-
void ImplFontMetricData::ImplInitTextLineSize( const OutputDevice* pDev )
{
long nDescent = mnDescent;