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

Alexandre Julliard julliard at winehq.org
Mon Feb 19 13:52:01 CST 2018


Module: wine
Branch: master
Commit: 77c7475269fafa9f9f5afa57b071516e22ba6696
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=77c7475269fafa9f9f5afa57b071516e22ba6696

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Feb 18 21:56:36 2018 +0330

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 at codeweavers.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/usp10/tests/usp10.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c
index 5c04441..de91cb8 100644
--- a/dlls/usp10/tests/usp10.c
+++ b/dlls/usp10/tests/usp10.c
@@ -1289,11 +1289,12 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co
             if (*hfont)
             {
                 winetest_trace("using font %s\n",lParam.lf.lfFaceName);
-                *origFont = SelectObject(hdc,*hfont);
                 if (fingerprint)
                 {
                     WORD output[10];
                     int i;
+
+                    *origFont = SelectObject(hdc,*hfont);
                     if (GetGlyphIndicesW(hdc, fingerprint->check, 10, output, 0) != GDI_ERROR)
                     {
                         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;
                     }
+                    SelectObject(hdc, *origFont);
                 }
                 else rc = 1;
             }




More information about the wine-cvs mailing list