Jacek Caban : gdi32: Use single get_cptable implementation.

Alexandre Julliard julliard at winehq.org
Wed Sep 29 15:54:10 CDT 2021


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Sep 29 14:09:28 2021 +0200

gdi32: Use single get_cptable implementation.

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

---

 dlls/gdi32/font.c          |  2 +-
 dlls/gdi32/freetype.c      | 15 ---------------
 dlls/gdi32/ntgdi_private.h |  1 +
 3 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 0a2a39d3da8..5864eb88498 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -3208,7 +3208,7 @@ static UINT get_glyph_index_symbol( struct gdi_font *font, UINT glyph )
     return index;
 }
 
-static CPTABLEINFO *get_cptable( WORD cp )
+CPTABLEINFO *get_cptable( WORD cp )
 {
     static CPTABLEINFO tables[100];
     unsigned int i;
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index a3679d854a4..2a67fa76062 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -730,21 +730,6 @@ static const LANGID mac_langid_table[] =
     MAKELANGID(LANG_AZERI,SUBLANG_AZERI_LATIN),              /* TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT */
 };
 
-static CPTABLEINFO *get_cptable( WORD cp )
-{
-    static CPTABLEINFO tables[100];
-    unsigned int i;
-    USHORT *ptr;
-    SIZE_T size;
-
-    for (i = 0; i < ARRAY_SIZE(tables) && tables[i].CodePage; i++)
-        if (tables[i].CodePage == cp) return &tables[i];
-    if (NtGetNlsSectionPtr( 11, cp, NULL, (void **)&ptr, &size )) return NULL;
-    if (i == ARRAY_SIZE(tables)) ERR( "too many code pages\n" );
-    RtlInitCodePageTable( ptr, &tables[i] );
-    return &tables[i];
-}
-
 static CPTABLEINFO *get_mac_code_page( const FT_SfntName *name )
 {
     int id = name->encoding_id;
diff --git a/dlls/gdi32/ntgdi_private.h b/dlls/gdi32/ntgdi_private.h
index e2211ad80eb..1b55b5ad458 100644
--- a/dlls/gdi32/ntgdi_private.h
+++ b/dlls/gdi32/ntgdi_private.h
@@ -334,6 +334,7 @@ extern int add_gdi_face( const WCHAR *family_name, const WCHAR *second_name,
                          const struct bitmap_font_size *size ) DECLSPEC_HIDDEN;
 extern UINT font_init(void) DECLSPEC_HIDDEN;
 extern UINT get_acp(void) DECLSPEC_HIDDEN;
+extern CPTABLEINFO *get_cptable( WORD cp ) DECLSPEC_HIDDEN;
 extern const struct font_backend_funcs *init_freetype_lib(void) DECLSPEC_HIDDEN;
 
 /* opentype.c */




More information about the wine-cvs mailing list