From a6431c3868f798fcf1d1f75d0e019e2cd5facefd Mon Sep 17 00:00:00 2001 From: Ulrich Czekalla Date: Mon, 27 Mar 2006 11:33:56 -0500 Subject: [PATCH] commdlg: Properly set and retrieve colour value from combo box . --- dlls/commdlg/fontdlg.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/commdlg/fontdlg.c b/dlls/commdlg/fontdlg.c index b85bcae6c1c..a80e3c1389c 100644 --- a/dlls/commdlg/fontdlg.c +++ b/dlls/commdlg/fontdlg.c @@ -632,9 +632,9 @@ LRESULT CFn_WMInitDialog(HWND hDlg, WPARAM wParam, LPARAM lParam, memcpy(name, strColorName, sizeof(strColorName)); } j=SendDlgItemMessageW(hDlg, cmb4, CB_ADDSTRING, 0, (LPARAM)name); - SendDlgItemMessageW(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[j]); + SendDlgItemMessageW(hDlg, cmb4, CB_SETITEMDATA, j, textcolors[i]); /* look for a fitting value in color combobox */ - if (textcolors[j]==lpcf->rgbColors) + if (textcolors[i]==lpcf->rgbColors) SendDlgItemMessageW(hDlg,cmb4, CB_SETCURSEL,j,0); } } @@ -994,7 +994,7 @@ LRESULT CFn_WMCommand(HWND hDlg, WPARAM wParam, LPARAM lParam, { WINDOWINFO wininfo; - lpcf->rgbColors=textcolors[i]; + lpcf->rgbColors = SendDlgItemMessageW(hDlg, cmb4, CB_GETITEMDATA, i, 0); wininfo.cbSize=sizeof(wininfo); if( GetWindowInfo( GetDlgItem( hDlg, stc5), &wininfo ) )