Module: wine Branch: master Commit: 002b7c82be640f47135007b484773e1adb924a94 URL: http://source.winehq.org/git/wine.git/?a=commit;h=002b7c82be640f47135007b484...
Author: Joris Huizer jorishuizer@debian Date: Thu Jun 26 22:25:28 2008 +0200
gdiplus: Change tmw field of GpFontFamily into an embedded structure.
---
dlls/gdiplus/font.c | 10 +++------- dlls/gdiplus/gdiplus_private.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 4b784f6..86a3223 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -94,7 +94,7 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, { WCHAR facename[LF_FACESIZE]; LOGFONTW* lfw; - TEXTMETRICW* tmw; + const TEXTMETRICW* tmw; GpStatus stat;
if ((!fontFamily && fontFamily->FamilyName && font)) @@ -107,7 +107,7 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, if (stat != Ok) return stat; *font = GdipAlloc(sizeof(GpFont));
- tmw = fontFamily->tmw; + tmw = &fontFamily->tmw; lfw = &((*font)->lfw); ZeroMemory(&(*lfw), sizeof(*lfw));
@@ -366,21 +366,18 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
ffamily = GdipAlloc(sizeof (GpFontFamily)); if (!ffamily) return OutOfMemory; - ffamily->tmw = GdipAlloc(sizeof (TEXTMETRICW)); - if (!ffamily->tmw) {GdipFree (ffamily); return OutOfMemory;}
hdc = GetDC(0); lstrcpynW(lfw.lfFaceName, name, sizeof(WCHAR) * LF_FACESIZE); hFont = CreateFontIndirectW (&lfw); hfont_old = SelectObject(hdc, hFont);
- GetTextMetricsW(hdc, ffamily->tmw); + GetTextMetricsW(hdc, &ffamily->tmw); DeleteObject(SelectObject(hdc, hfont_old));
ffamily->FamilyName = GdipAlloc(LF_FACESIZE * sizeof (WCHAR)); if (!ffamily->FamilyName) { - GdipFree(ffamily->tmw); GdipFree(ffamily); ReleaseDC(0, hdc); return OutOfMemory; @@ -448,7 +445,6 @@ GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily *FontFamily) TRACE("Deleting %p (%s)\n", FontFamily, debugstr_w(FontFamily->FamilyName));
if (FontFamily->FamilyName) GdipFree (FontFamily->FamilyName); - if (FontFamily->tmw) GdipFree (FontFamily->tmw); GdipFree (FontFamily);
return Ok; diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 6042835..b8269f2 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -192,7 +192,7 @@ struct GpFontCollection{ };
struct GpFontFamily{ - TEXTMETRICW* tmw; + TEXTMETRICW tmw; WCHAR* FamilyName; };