summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/CommonSalLayout.cxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2016-10-30 22:09:10 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2016-10-30 22:10:51 +0200
commit641b9cb1d0934b3f8b4a80279cb3f3f81ecc4707 (patch)
tree023a1b47187a8061ad9c9e114b537dbad4c546c3 /vcl/source/gdi/CommonSalLayout.cxx
parentffed74ee5450e6f6dd63ad3db489ebdbaa13d5fd (diff)
tdf#103588: Draw with the right font on Windows
Apparently without implementing InitFont(), we might end up drawing with the wrong font, thanks to the arcane ways GDI API. Change-Id: I224de138446d4a536e13992efa98b0f04609576a
Diffstat (limited to 'vcl/source/gdi/CommonSalLayout.cxx')
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index dc6ca2cc745d..e7f282627ee7 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -172,12 +172,13 @@ void CommonSalLayout::ParseFeatures(const OUString& name)
#if defined(_WIN32)
CommonSalLayout::CommonSalLayout(HDC hDC, WinFontInstance& rWinFontInstance, const WinFontFace& rWinFontFace)
: mrFontSelData(rWinFontInstance.maFontSelData)
+, mhDC(hDC)
+, mhFont(static_cast<HFONT>(GetCurrentObject(hDC, OBJ_FONT)))
{
mpHbFont = rWinFontFace.GetHbFont();
if (!mpHbFont)
{
- HFONT hFont = static_cast<HFONT>(GetCurrentObject(hDC, OBJ_FONT));
- hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, hFont, nullptr);
+ hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, mhFont, nullptr);
mpHbFont = createHbFont(pHbFace);
rWinFontFace.SetHbFont(mpHbFont);