Huw Davies : gdi32: Add an internal version of GetTextCharsetInfo() that takes a DC pointer.

Alexandre Julliard julliard at winehq.org
Fri Jul 29 10:17:09 CDT 2016


Module: wine
Branch: master
Commit: 41f763ea879045464b02d45c048852e7e13cea93
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=41f763ea879045464b02d45c048852e7e13cea93

Author: Huw Davies <huw at codeweavers.com>
Date:   Fri Jul 29 13:13:06 2016 +0100

gdi32: Add an internal version of GetTextCharsetInfo() that takes a DC pointer.

Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/font.c | 57 ++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 35 insertions(+), 22 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index b42aaa6..2faefe8 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -407,6 +407,40 @@ DWORD WINAPI GdiGetCodePage( HDC hdc )
 }
 
 /***********************************************************************
+ *           get_text_charset_info
+ *
+ * Internal version of GetTextCharsetInfo() that takes a DC pointer.
+ */
+static UINT get_text_charset_info(DC *dc, FONTSIGNATURE *fs, DWORD flags)
+{
+    UINT ret = DEFAULT_CHARSET;
+    PHYSDEV dev;
+
+    dev = GET_DC_PHYSDEV( dc, pGetTextCharsetInfo );
+    ret = dev->funcs->pGetTextCharsetInfo( dev, fs, flags );
+
+    if (ret == DEFAULT_CHARSET && fs)
+        memset(fs, 0, sizeof(FONTSIGNATURE));
+    return ret;
+}
+
+/***********************************************************************
+ *           GetTextCharsetInfo    (GDI32.@)
+ */
+UINT WINAPI GetTextCharsetInfo(HDC hdc, FONTSIGNATURE *fs, DWORD flags)
+{
+    UINT ret = DEFAULT_CHARSET;
+    DC *dc = get_dc_ptr(hdc);
+
+    if (dc)
+    {
+        ret = get_text_charset_info( dc, fs, flags );
+        release_dc_ptr( dc );
+    }
+    return ret;
+}
+
+/***********************************************************************
  *           FONT_mbtowc
  *
  * Returns a Unicode translation of str using the charset of the
@@ -646,7 +680,7 @@ static DWORD get_associated_charset_info(void)
 static void update_font_code_page( DC *dc, HANDLE font )
 {
     CHARSETINFO csi;
-    int charset = GetTextCharsetInfo( dc->hSelf, NULL, 0 );
+    int charset = get_text_charset_info( dc, NULL, 0 );
     LOGFONTW lf;
 
     GetObjectW( font, sizeof(lf), &lf );
@@ -3689,27 +3723,6 @@ UINT WINAPI GetTextCharset(HDC hdc)
 }
 
 /***********************************************************************
- *           GetTextCharsetInfo    (GDI32.@)
- */
-UINT WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE fs, DWORD flags)
-{
-    UINT ret = DEFAULT_CHARSET;
-    DC *dc = get_dc_ptr(hdc);
-    PHYSDEV dev;
-
-    if (dc)
-    {
-        dev = GET_DC_PHYSDEV( dc, pGetTextCharsetInfo );
-        ret = dev->funcs->pGetTextCharsetInfo( dev, fs, flags );
-        release_dc_ptr( dc );
-    }
-
-    if (ret == DEFAULT_CHARSET && fs)
-        memset(fs, 0, sizeof(FONTSIGNATURE));
-    return ret;
-}
-
-/***********************************************************************
  *           GdiGetCharDimensions    (GDI32.@)
  *
  * Gets the average width of the characters in the English alphabet.




More information about the wine-cvs mailing list