[Libreoffice-commits] core.git: vcl/inc vcl/win

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 08:48:04 UTC 2018


 vcl/inc/win/winlayout.hxx |    6 ++++--
 vcl/win/gdi/salfont.cxx   |    6 +++---
 vcl/win/gdi/winlayout.cxx |    2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 9e568efaad811e57e89ca68649d5112d77c7957a
Author:     Noel Grandin <noel at peralex.com>
AuthorDate: Fri Sep 14 08:50:51 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Sep 14 10:47:39 2018 +0200

    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 at collabora.co.uk>

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)


More information about the Libreoffice-commits mailing list