From 6dc401e2e78bcec263e60eaadf7b22d4cef699d3 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Fri, 4 Jan 2002 18:23:46 +0000 Subject: [PATCH] Remove a call to HEAP_strdupAtoW in the Color dialog. --- dlls/commdlg/colordlg.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/commdlg/colordlg.c b/dlls/commdlg/colordlg.c index 9dc32cd22a3..5b238602f8a 100644 --- a/dlls/commdlg/colordlg.c +++ b/dlls/commdlg/colordlg.c @@ -18,7 +18,6 @@ #include "wingdi.h" #include "wine/winbase16.h" #include "wine/winuser16.h" -#include "heap.h" #include "commdlg.h" #include "dlgs.h" #include "debugtools.h" @@ -1508,10 +1507,13 @@ BOOL WINAPI ChooseColorA( LPCHOOSECOLORA lpChCol ) lpcc->lCustData = lpChCol->lCustData; lpcc->lpfnHook = (LPCCHOOKPROC) lpChCol->lpfnHook; if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName)) { - if (HIWORD(lpChCol->lpTemplateName)) - lpcc->lpTemplateName = HEAP_strdupAtoW(GetProcessHeap(), 0, lpChCol->lpTemplateName); - else + if (HIWORD(lpChCol->lpTemplateName)) { + INT len = MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, NULL, 0); + lpcc->lpTemplateName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, lpcc->lpTemplateName, len ); + } else { lpcc->lpTemplateName = (LPWSTR)lpChCol->lpTemplateName; + } } ret = ChooseColorW(lpcc);