Commit cc6d2f90 authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard

Don't use the template member unless the corresponding flag is set.

parent fd40e89f
/* TODO : WS_CLIPCHILDREN in cdlg*.h
fix CHOOSECOLORW (lpCustColor) */
/*
* COMMDLG - Color Dialog
*
......@@ -1451,9 +1449,7 @@ BOOL WINAPI ChooseColorA( LPCHOOSECOLORA lpChCol )
{
BOOL ret;
WCHAR *wstr = NULL;
LPCHOOSECOLORW lpcc = HeapAlloc( GetProcessHeap(), 0, sizeof(CHOOSECOLORW));
LPCHOOSECOLORW lpcc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CHOOSECOLORW));
lpcc->lStructSize = sizeof(*lpcc);
lpcc->hwndOwner = lpChCol->hwndOwner;
lpcc->hInstance = lpChCol->hInstance;
......@@ -1462,15 +1458,14 @@ BOOL WINAPI ChooseColorA( LPCHOOSECOLORA lpChCol )
lpcc->Flags = lpChCol->Flags;
lpcc->lCustData = lpChCol->lCustData;
lpcc->lpfnHook = (LPCCHOOKPROC) lpChCol->lpfnHook;
if (lpChCol->lpTemplateName)
wstr = HEAP_strdupAtoW( GetProcessHeap(), 0, lpChCol->lpTemplateName);
lpcc->lpTemplateName = wstr;
if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName))
lpcc->lpTemplateName = HEAP_strdupAtoW(GetProcessHeap(), 0, lpChCol->lpTemplateName);
ret = ChooseColorW(lpcc);
if ( ret )
if (ret)
lpChCol->rgbResult = lpcc->rgbResult;
if ( wstr ) HeapFree( GetProcessHeap(), 0, wstr);
HeapFree( GetProcessHeap(), 0, lpcc );
if (lpcc->lpTemplateName) HeapFree(GetProcessHeap(), 0, lpcc->lpTemplateName);
HeapFree(GetProcessHeap(), 0, lpcc);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment