summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-09-10 13:15:36 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-09-11 16:10:08 +0200
commit2ee177e58a57420eaa18b9d39ade4c28907bc0c8 (patch)
treeb9496c96d361219e759ca6b7f3353ed5d652d26f
parentbb209f2f53edc1b0d268d561e0c12bf93e83fb41 (diff)
tdf#119756 assume the HFONT is always valid
This is a regression from the commit 7cb3e475f2fb ("WIN add SalGraphics* to WinFontInstance"). We need a sensible way to compare the SalGraphics / HFONT. I'm not sure how to implement this yet, so just assume unchanged, as the old code did. Change-Id: I828a41e529976c500eedaef3afd40cf20287f746 Reviewed-on: https://gerrit.libreoffice.org/60256 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
-rw-r--r--vcl/win/gdi/winlayout.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index a1d76c8026a4..5cef9f5534aa 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -395,10 +395,9 @@ hb_font_t* WinFontInstance::ImplInitHbFont()
void WinFontInstance::SetGraphics(WinSalGraphics *pGraphics)
{
- ReleaseHbFont();
- if (m_hFont)
- ::DeleteFont(m_hFont);
m_pGraphics = pGraphics;
+ if (m_hFont)
+ return;
HFONT hOrigFont;
m_hFont = m_pGraphics->ImplDoSetFont(GetFontSelectPattern(), GetFontFace(), m_fScale, hOrigFont);
SelectObject(m_pGraphics->getHDC(), hOrigFont);