diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-01 17:52:50 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-01-01 18:51:23 +0000 |
commit | 264e6c04afaff96dda6cd510c1da90bb519a1f66 (patch) | |
tree | 8ad63fa1ad70136ee105b91a054f128bd4522281 /vcl/generic/glyphs | |
parent | loplugin:passstuffbyref (diff) | |
download | core-264e6c04afaff96dda6cd510c1da90bb519a1f66.tar.gz core-264e6c04afaff96dda6cd510c1da90bb519a1f66.zip |
vcl: remove poor-man's RTTI in PhysicalFontFace
The *only* things relying on the in-built magic number are PDFFontCache
and PDFWriterImpl. PDFWriterImpl::emitBuiltinFont has as its first
parameter a const PhysicalFontFace*, but this is only called upon by
PDFWriterImpl::emitFonts, which instantiates an ImplPdfBuiltinFontData
object from a built-in font map... so basically it is always guaranteed
to get a ImplPdfBuiltinFontData object. ImplPdfBuiltinFontData derives
from PhysicalFontFace, so to prevent the need to check the class being
used is a ImplPdfBuiltinFontData, just make emitBuiltinFont require as
it's first parameter ImplPdfBuiltinFontData!
Unfortunately, we can't get around RTTI completely, because
PDFFontCache::FontIdentifier requires a way of distinguishing between
two different PhysicalFontFaces...
Change-Id: I74c8cd294580bbecd12dd2427ac405f97a7e7f7e
Reviewed-on: https://gerrit.libreoffice.org/21030
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/generic/glyphs')
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.hxx | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index f5b4a0d3ca1c..a570548feb1b 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -420,7 +420,7 @@ ServerFont* FreetypeManager::CreateFont( const FontSelectPattern& rFSD ) } ImplFTSFontData::ImplFTSFontData( FtFontInfo* pFI, const ImplFontAttributes& rDFA ) -: PhysicalFontFace( rDFA, IFTSFONT_MAGIC ), +: PhysicalFontFace( rDFA ), mpFtFontInfo( pFI ) { SetBuiltInFontFlag( false ); diff --git a/vcl/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx index 1fe995ae0169..32777770db03 100644 --- a/vcl/generic/glyphs/gcach_ftyp.hxx +++ b/vcl/generic/glyphs/gcach_ftyp.hxx @@ -150,7 +150,6 @@ class ImplFTSFontData : public PhysicalFontFace { private: FtFontInfo* mpFtFontInfo; - enum { IFTSFONT_MAGIC = 0x1F150A1C }; public: ImplFTSFontData( FtFontInfo*, const ImplFontAttributes& ); |