summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-11-22 06:32:55 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-11-23 19:29:38 +0100
commitc2a581ffc1f4e3888c5c243932b71c3d96e8ba8f (patch)
treea17b611d6702aac833763c051817ac7829ce1881 /vcl/inc
parent90db4351138dec97f8dd2ebc350e8aef18a5358f (diff)
tdf#62812 WIN use a compatible DC for font funcs
All these function work on a temporary font. It's not clear, if the CreateCompatibleDC is actually needed and if the ScopedFontDC could actually just use the SalGraphics DC and restore its HFONT, but this at least now works as expected. A later patch can just drop the CreateCompatibleDC and DeleteDC calls. Change-Id: I6e86d660e69a58fa2eab89ece80c61e2635fc792 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125652 Tested-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/win/salgdi.h2
-rw-r--r--vcl/inc/win/winlayout.hxx4
2 files changed, 1 insertions, 5 deletions
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 974c58ae81ad..8c6c1adcdbed 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -181,7 +181,7 @@ private:
void DeInitGraphics();
public:
- HFONT ImplDoSetFont(vcl::font::FontSelectPattern const & i_rFont, const vcl::font::PhysicalFontFace * i_pFontFace, HFONT& o_rOldFont);
+ HFONT ImplDoSetFont(HDC hDC, vcl::font::FontSelectPattern const & i_rFont, const vcl::font::PhysicalFontFace * i_pFontFace, HFONT& o_rOldFont);
HDC getHDC() const { return mhLocalDC; }
// NOTE: this doesn't transfer ownership! See class comment.
diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx
index 93aa0a3d00de..29bccf5acf4f 100644
--- a/vcl/inc/win/winlayout.hxx
+++ b/vcl/inc/win/winlayout.hxx
@@ -45,10 +45,6 @@ public:
HFONT GetHFONT() const { return m_hFont; }
float GetScale() const { return m_fScale; }
- // Prevent deletion of the HFONT in the WinFontInstance destructor
- // Used for the ScopedFont handling
- void SetHFONT(HFONT hFont) { m_hFont = hFont; }
-
const WinFontFace * GetFontFace() const { return static_cast<const WinFontFace *>(LogicalFontInstance::GetFontFace()); }
WinFontFace * GetFontFace() { return static_cast<WinFontFace *>(LogicalFontInstance::GetFontFace()); }