- Fixed access to the lpTemplateName of ChooseFont in cases where the

flags don't specify to use it.
- Do not try to convert the resource name from ANSI to Wide if it is a
  result of MAKEINTRESOURCE (and therefore not a string).
This commit is contained in:
Shachar Shemesh 2002-07-10 20:31:17 +00:00 committed by Alexandre Julliard
parent c345f7b953
commit d386fa75bc
1 changed files with 2 additions and 4 deletions

View File

@ -323,7 +323,7 @@ static BOOL ChooseFontWtoA(const CHOOSEFONTW *cfw, CHOOSEFONTA *cfa)
LogFontWtoA(cfw->lpLogFont, lpLogFont);
if (cfw->lpTemplateName != NULL)
if ((cfw->Flags&CF_ENABLETEMPLATE)!=0 && HIWORD(cfw->lpTemplateName)!=0)
{
cfa->lpTemplateName = HEAP_strdupWtoA(GetProcessHeap(), 0,
cfw->lpTemplateName);
@ -354,7 +354,7 @@ static VOID ChooseFontAtoW(const CHOOSEFONTA *cfa, CHOOSEFONTW *cfw)
LogFontAtoW(cfa->lpLogFont, lpLogFont);
if (cfa->lpTemplateName != NULL)
if ((cfa->Flags&CF_ENABLETEMPLATE)!=0 && HIWORD(cfa->lpTemplateName) != 0)
HeapFree(GetProcessHeap(), 0, (LPSTR)(cfa->lpTemplateName));
if ((cfa->Flags & CF_USESTYLE) != 0 && cfa->lpszStyle != NULL)
@ -1300,5 +1300,3 @@ LRESULT WINAPI FormatCharDlgProcW(HWND hDlg, UINT uMsg, WPARAM wParam,
}
return res;
}