summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-05-12 15:11:10 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2018-05-12 20:00:26 +0200
commite8d48dd75a1bb31b5bc500bc79fb80384a09bcc6 (patch)
tree68f4b98d9c88e4e79c50f97b0a7178e53e26f629 /vcl
parentab03a09745fe52209747fb901eca91ef14cda5a5 (diff)
Fixup 23c5125148a8110d88385b29570bf0b7d4400458
It was asserting for me at startup on Windows. Change-Id: I81d7b0dd58fd912c5fc255c3a7fa0878e841737e Reviewed-on: https://gerrit.libreoffice.org/54160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/gdi/salfont.cxx1
-rw-r--r--vcl/win/gdi/winlayout.cxx3
2 files changed, 3 insertions, 1 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index e1c26ed902a2..2d6512154e2a 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -997,6 +997,7 @@ void WinSalGraphics::GetFontMetric( ImplFontMetricDataRef& rxFontMetric, int nFa
const RawFontData aHheaRawData(getHDC(), nHheaTag);
const RawFontData aOS2RawData(getHDC(), nOS2Tag);
+ mpWinFontEntry[nFallbackLevel]->SetHDC(getHDC());
rxFontMetric->SetMinKashida(mpWinFontEntry[nFallbackLevel]->GetKashidaWidth());
// get the font metric
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 95034c97372b..656681a46a8a 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -342,7 +342,7 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
hb_font_t* WinFontInstance::ImplInitHbFont()
{
assert(m_hDC);
- m_hFont = static_cast<HFONT>(GetCurrentObject(m_hDC, OBJ_FONT));
+ assert(m_hFont);
hb_font_t* pHbFont = InitHbFont(hb_face_create_for_tables(getFontTable, m_hFont, nullptr));
// Calculate the AverageWidthFactor, see LogicalFontInstance::GetScale().
@@ -378,6 +378,7 @@ void WinFontInstance::SetHDC(const HDC hDC)
return;
ReleaseHbFont();
m_hDC = hDC;
+ m_hFont = static_cast<HFONT>(GetCurrentObject(m_hDC, OBJ_FONT));
}
bool WinSalGraphics::CacheGlyphs(const GenericSalLayout& rLayout)