diff options
author | Noel Grandin <noel@peralex.com> | 2018-09-14 08:50:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-14 10:47:39 +0200 |
commit | 9e568efaad811e57e89ca68649d5112d77c7957a (patch) | |
tree | a7049ecd034f0301e824c9b103bc11f598995819 | |
parent | eaf6fa7dd8643a6d02704797b51e7a815b31f0bb (diff) |
make WinFontInstance take and return a WinFontFace
to make the handling more explicit here
Change-Id: I934fcc7b0da8a160acd904440f18fc6c01ec1ad3
Reviewed-on: https://gerrit.libreoffice.org/60475
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/inc/win/winlayout.hxx | 6 | ||||
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 6 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 161b3666e06a..b08a5d0ab78f 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -142,7 +142,7 @@ public: } }; -// win32 specific physical font instance +// win32 specific logical font instance class WinFontInstance : public LogicalFontInstance { friend rtl::Reference<LogicalFontInstance> WinFontFace::CreateFontInstance(const FontSelectPattern&) const; @@ -164,8 +164,10 @@ public: // Used for the ScopedFont handling void SetHFONT(HFONT hFont) { m_hFont = hFont; } + const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); } + private: - explicit WinFontInstance(const PhysicalFontFace&, const FontSelectPattern&); + explicit WinFontInstance(const WinFontFace&, const FontSelectPattern&); virtual hb_font_t* ImplInitHbFont() override; diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index ae8628079021..6b50e55433f2 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -950,7 +950,7 @@ void WinSalGraphics::SetFont(LogicalFontInstance* pFont, int nFallbackLevel) } // now the font is live => update font face - const WinFontFace* pFontFace = static_cast<const WinFontFace*>(pFontInstance->GetFontFace()); + const WinFontFace* pFontFace = pFontInstance->GetFontFace(); pFontFace->UpdateFromHDC(getHDC()); } @@ -1004,14 +1004,14 @@ const FontCharMapRef WinSalGraphics::GetFontCharMap() const FontCharMapRef xDefFontCharMap( new FontCharMap() ); return xDefFontCharMap; } - return static_cast<const WinFontFace*>(mpWinFontEntry[0]->GetFontFace())->GetFontCharMap(); + return mpWinFontEntry[0]->GetFontFace()->GetFontCharMap(); } bool WinSalGraphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const { if (!mpWinFontEntry[0]) return false; - return static_cast<const WinFontFace*>(mpWinFontEntry[0]->GetFontFace())->GetFontCapabilities(rFontCapabilities); + return mpWinFontEntry[0]->GetFontFace()->GetFontCapabilities(rFontCapabilities); } int CALLBACK SalEnumFontsProcExW( const LOGFONTW* lpelfe, diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 5cef9f5534aa..84cc3600de3b 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -312,7 +312,7 @@ std::unique_ptr<SalLayout> WinSalGraphics::GetTextLayout(ImplLayoutArgs& /*rArgs return std::unique_ptr<SalLayout>(aLayout); } -WinFontInstance::WinFontInstance(const PhysicalFontFace& rPFF, const FontSelectPattern& rFSP) +WinFontInstance::WinFontInstance(const WinFontFace& rPFF, const FontSelectPattern& rFSP) : LogicalFontInstance(rPFF, rFSP) , m_pGraphics(nullptr) , m_hFont(nullptr) |