fontdlg16: choosefont16to32 fix.
Rein Klazes
wijn at wanadoo.nl
Tue Nov 22 08:08:51 CST 2005
Hi,
Changelog:
dlls/commdlg : fontdlg16.c
In CFn_CHOOSEFONT16to32W fix the conversion of the lpTemplateName and
the lpszStyle fields.
Rein.
-------------- next part --------------
--- wine/dlls/commdlg/fontdlg16.c 2005-07-08 12:38:56.000000000 +0200
+++ mywine/dlls/commdlg/fontdlg16.c 2005-11-22 14:48:28.000000000 +0100
@@ -72,19 +72,21 @@ static void FONT_Metrics16To32W( const T
static void CFn_CHOOSEFONT16to32W(LPCHOOSEFONT16 chf16, LPCHOOSEFONTW chf32w)
{
int len;
- if(chf16->lpTemplateName)
+ if(( chf16->Flags & CF_ENABLETEMPLATE))
{
- len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)chf16->lpTemplateName, -1, NULL, 0);
- chf32w->lpTemplateName = HeapAlloc(GetProcessHeap(), 0,len*sizeof(WCHAR));
- MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
- -1, (LPWSTR)chf32w->lpTemplateName, len);
+ len = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)MapSL( chf16->lpTemplateName),
+ -1, NULL, 0);
+ chf32w->lpTemplateName = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ MultiByteToWideChar( CP_ACP, 0, (LPSTR)MapSL( chf16->lpTemplateName),
+ -1, (LPWSTR)chf32w->lpTemplateName, len);
}
- if(chf16->lpszStyle)
+ if(( chf16->Flags & CF_USESTYLE))
{
- len = MultiByteToWideChar(CP_ACP, 0, (LPCSTR)chf16->lpszStyle, -1, NULL, 0);
- chf32w->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
- MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
- -1, chf32w->lpszStyle, len);
+ len = MultiByteToWideChar( CP_ACP, 0, (LPCSTR)MapSL( chf16->lpszStyle),
+ -1, NULL, 0);
+ chf32w->lpszStyle = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ MultiByteToWideChar( CP_ACP, 0, (LPSTR)MapSL( chf16->lpszStyle),
+ -1, chf32w->lpszStyle, len);
}
chf32w->lStructSize=sizeof(CHOOSEFONTW);
chf32w->hwndOwner=HWND_32(chf16->hwndOwner);
@@ -95,7 +97,6 @@ static void CFn_CHOOSEFONT16to32W(LPCHOO
chf32w->lCustData=chf16->lCustData;
chf32w->lpfnHook=NULL;
chf32w->hInstance=HINSTANCE_32(chf16->hInstance);
- chf32w->lpszStyle=MapSL(chf16->lpszStyle);
chf32w->nFontType=chf16->nFontType;
chf32w->nSizeMax=chf16->nSizeMax;
chf32w->nSizeMin=chf16->nSizeMin;
More information about the wine-patches
mailing list