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>
This commit is contained in:
Khaled Hosny
2018-05-12 15:11:10 +02:00
parent ab03a09745
commit e8d48dd75a
2 changed files with 3 additions and 1 deletions

View File

@@ -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

View File

@@ -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)