vcl/win/gdi/winlayout.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 2ee177e58a57420eaa18b9d39ade4c28907bc0c8
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Mon Sep 10 13:15:36 2018 +0200
Commit:     Jan-Marek Glogowski <glo...@fbihome.de>
CommitDate: Tue Sep 11 16:10:08 2018 +0200

    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 <glo...@fbihome.de>

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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to