usp10/tests: Also restore the previous font when the finger print matches in _find_font_for_range().

Otherwise the subsequent SelectObject() call will set *origFont to *hfont.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2018-02-18 21:38:36 +03:30 committed by Alexandre Julliard
parent 6ca15e9c13
commit 77c7475269
1 changed files with 3 additions and 1 deletions

View File

@ -1289,11 +1289,12 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co
if (*hfont) if (*hfont)
{ {
winetest_trace("using font %s\n",lParam.lf.lfFaceName); winetest_trace("using font %s\n",lParam.lf.lfFaceName);
*origFont = SelectObject(hdc,*hfont);
if (fingerprint) if (fingerprint)
{ {
WORD output[10]; WORD output[10];
int i; int i;
*origFont = SelectObject(hdc,*hfont);
if (GetGlyphIndicesW(hdc, fingerprint->check, 10, output, 0) != GDI_ERROR) if (GetGlyphIndicesW(hdc, fingerprint->check, 10, output, 0) != GDI_ERROR)
{ {
for (i=0; i < 10; i++) for (i=0; i < 10; i++)
@ -1307,6 +1308,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co
} }
if (i == 10) rc = 1; if (i == 10) rc = 1;
} }
SelectObject(hdc, *origFont);
} }
else rc = 1; else rc = 1;
} }