comdlg32: Uses SetDlgItemInt() to simplify the code.

Signed-off-by: Carlo Bramini <carlo_bramini@users.sourceforge.net>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Carlo Bramini 2016-10-15 13:39:31 +02:00 committed by Alexandre Julliard
parent b466e89311
commit a1b0d92587
2 changed files with 7 additions and 18 deletions

View File

@ -673,15 +673,11 @@ static void CC_EditSetRGB( CCPRIV *infoPtr )
int r = GetRValue(cr);
int g = GetGValue(cr);
int b = GetBValue(cr);
char buffer[10];
infoPtr->updating = TRUE;
sprintf(buffer, "%d", r);
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_R), buffer);
sprintf(buffer, "%d", g);
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_G), buffer);
sprintf( buffer, "%d", b );
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_B), buffer);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_R, r, TRUE);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_G, g, TRUE);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_B, b, TRUE);
infoPtr->updating = FALSE;
}
}
@ -693,15 +689,10 @@ static void CC_EditSetHSL( CCPRIV *infoPtr )
{
if (IsWindowVisible( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_GRAPH) )) /* if full size */
{
char buffer[10];
infoPtr->updating = TRUE;
sprintf(buffer, "%d", infoPtr->h);
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_H), buffer);
sprintf(buffer, "%d", infoPtr->s);
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_S), buffer);
sprintf(buffer, "%d", infoPtr->l);
SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_L), buffer);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_H, infoPtr->h, TRUE);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_S, infoPtr->s, TRUE);
SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_L, infoPtr->l, TRUE);
infoPtr->updating = FALSE;
}
CC_PaintLumBar(infoPtr);

View File

@ -534,7 +534,6 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *
static void CFn_FitFontSize( HWND hDlg, int points)
{
WCHAR buffW[16];
int i,n;
/* look for fitting font size in combobox3 */
@ -553,8 +552,7 @@ static void CFn_FitFontSize( HWND hDlg, int points)
}
/* no default matching size, set text manually */
sprintfW(buffW, fontsizefmtW, points);
SetDlgItemTextW(hDlg, cmb3, buffW);
SetDlgItemInt(hDlg, cmb3, points, TRUE);
}
static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )