[5/7] gdi32: implemetation of CreateFontIndirectEx (fix for 13064)

Nikolay Sivov bunglehead at gmail.com
Wed Jun 18 02:33:02 CDT 2008


Changelog:
    - Implementation of CreateFontIndirectEx (fix for 13064)

---
 dlls/gdi32/font.c       |   20 ++++++++++++++++++++
 dlls/gdi32/gdi32.spec   |    4 ++--
 dlls/gdi32/tests/font.c |   14 ++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 34aabd1..da434a0 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -392,6 +392,26 @@ HFONT WINAPI CreateFontIndirectW( const LOGFONTW *plf )
     return hFont;
 }
 
+/***********************************************************************
+ *           CreateFontIndirectExA   (GDI32.@)
+ */
+HFONT WINAPI CreateFontIndirectExA( const ENUMLOGFONTEXDVA *plf )
+{
+    if(!plf)  return NULL;
+
+    return CreateFontIndirectA(&(plf->elfEnumLogfontEx.elfLogFont));
+}
+
+/***********************************************************************
+ *           CreateFontIndirectExW   (GDI32.@)
+ */
+HFONT WINAPI CreateFontIndirectExW( const ENUMLOGFONTEXDVW *plf )
+{
+    if(!plf)  return NULL;
+
+    return CreateFontIndirectW(&(plf->elfEnumLogfontEx.elfLogFont));
+}
+
 /*************************************************************************
  *           CreateFontA    (GDI32.@)
  */
diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec
index 99df6d1..c0e5456 100644
--- a/dlls/gdi32/gdi32.spec
+++ b/dlls/gdi32/gdi32.spec
@@ -58,8 +58,8 @@
 @ stdcall CreateEnhMetaFileW(long wstr ptr wstr)
 @ stdcall CreateFontA(long long long long long long long long long long long long long str)
 @ stdcall CreateFontIndirectA(ptr)
-# @ stub CreateFontIndirectExA
-# @ stub CreateFontIndirectExW
+@ stdcall CreateFontIndirectExA(ptr)
+@ stdcall CreateFontIndirectExW(ptr)
 @ stdcall CreateFontIndirectW(ptr)
 @ stdcall CreateFontW(long long long long long long long long long long long long long wstr)
 @ stdcall CreateHalftonePalette(long)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index 4d48bae..830b94c 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -119,9 +119,19 @@ static HFONT create_font(const char* test, const LOGFONTA* lf)
     return hfont;
 }
 
+static HFONT create_font_ex(const char* test, const ENUMLOGFONTEXDV* lfex)
+{
+    HFONT hfont = CreateFontIndirectExA(lfex);
+    ok(hfont != 0, "CreateFontIndirectEx failed\n");
+    if (hfont)
+        check_font(test, &(lfex->elfEnumLogfontEx.elfLogFont), hfont);
+    return hfont;
+}
+
 static void test_logfont(void)
 {
     LOGFONTA lf;
+    ENUMLOGFONTEXDVA lfex;
     HFONT hfont;
 
     memset(&lf, 0, sizeof lf);
@@ -137,6 +147,10 @@ static void test_logfont(void)
     hfont = create_font("Arial", &lf);
     DeleteObject(hfont);
 
+    lstrcpyA(lfex.elfEnumLogfontEx.elfLogFont.lfFaceName, "Arial");
+    hfont = create_font_ex("Arial", &lfex);
+    DeleteObject(hfont);
+
     memset(&lf, 'A', sizeof(lf));
     hfont = CreateFontIndirectA(&lf);
     ok(hfont != 0, "CreateFontIndirectA with strange LOGFONT failed\n");
-- 
1.4.4.4






More information about the wine-patches mailing list