summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/CommonSalLayout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/CommonSalLayout.cxx')
-rw-r--r--vcl/source/gdi/CommonSalLayout.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx
index 1a67243d38e0..54a8dc312398 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -53,13 +53,14 @@ static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pU
unsigned char* pBuffer = nullptr;
HFONT hFont = static_cast<HFONT>(pUserData);
HDC hDC = GetDC(nullptr);
- SelectObject(hDC, hFont);
+ HGDIOBJ hOrigFont = SelectObject(hDC, hFont);
nLength = ::GetFontData(hDC, OSL_NETDWORD(nTableTag), 0, nullptr, 0);
if (nLength > 0 && nLength != GDI_ERROR)
{
pBuffer = new unsigned char[nLength];
::GetFontData(hDC, OSL_NETDWORD(nTableTag), 0, pBuffer, nLength);
}
+ SelectObject(hDC, hOrigFont);
ReleaseDC(nullptr, hDC);
#elif defined(MACOSX) || defined(IOS)
unsigned char* pBuffer = nullptr;