Kaydet (Commit) 0f3c6f89 authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Michael Meeks

Error handling

Change-Id: I46e5463aaa5cab41cd69c13314ee98a0c73e7ba2
Signed-off-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst eaf20241
...@@ -271,6 +271,8 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou ...@@ -271,6 +271,8 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
if (!GetCharABCWidthsI(hDC, 0, nCount, aGlyphIndices.data(), aABC.data())) if (!GetCharABCWidthsI(hDC, 0, nCount, aGlyphIndices.data(), aABC.data()))
{ {
SAL_WARN("vcl.gdi", "GetCharABCWidthsI failed: " << WindowsErrorString(GetLastError())); SAL_WARN("vcl.gdi", "GetCharABCWidthsI failed: " << WindowsErrorString(GetLastError()));
SelectObject(hDC, hOrigFont);
DeleteDC(hDC);
return false; return false;
} }
...@@ -296,14 +298,34 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou ...@@ -296,14 +298,34 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
} }
TEXTMETRICW aTextMetric; TEXTMETRICW aTextMetric;
GetTextMetricsW(hDC, &aTextMetric); if (!GetTextMetricsW(hDC, &aTextMetric))
{
SAL_WARN("vcl.gdi", "GetTextMetrics failed: " << WindowsErrorString(GetLastError()));
SelectObject(hDC, hOrigFont);
DeleteDC(hDC);
return false;
}
aChunk.mnAscentPlusIntLeading = aTextMetric.tmAscent + aTextMetric.tmInternalLeading; aChunk.mnAscentPlusIntLeading = aTextMetric.tmAscent + aTextMetric.tmInternalLeading;
LOGFONTW aLogfont; LOGFONTW aLogfont;
GetObjectW(rLayout.mhFont, sizeof(aLogfont), &aLogfont); if (!GetObjectW(rLayout.mhFont, sizeof(aLogfont), &aLogfont))
{
SAL_WARN("vcl.gdi", "GetObject failed: " << WindowsErrorString(GetLastError()));
SelectObject(hDC, hOrigFont);
DeleteDC(hDC);
return false;
}
wchar_t sFaceName[200]; wchar_t sFaceName[200];
int nFaceNameLen = GetTextFaceW(hDC, SAL_N_ELEMENTS(sFaceName), sFaceName); int nFaceNameLen = GetTextFaceW(hDC, SAL_N_ELEMENTS(sFaceName), sFaceName);
if (!nFaceNameLen)
{
SAL_WARN("vcl.gdi", "GetTextFace failed: " << WindowsErrorString(GetLastError()));
SelectObject(hDC, hOrigFont);
DeleteDC(hDC);
return false;
}
SAL_INFO("vcl.gdi.opengl", OUString(sFaceName, nFaceNameLen) << SAL_INFO("vcl.gdi.opengl", OUString(sFaceName, nFaceNameLen) <<
": Escapement=" << aLogfont.lfEscapement << ": Escapement=" << aLogfont.lfEscapement <<
" Orientation=" << aLogfont.lfOrientation << " Orientation=" << aLogfont.lfOrientation <<
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment