Commit a1b0d925 authored by Carlo Bramini's avatar Carlo Bramini Committed by Alexandre Julliard

comdlg32: Uses SetDlgItemInt() to simplify the code.

parent b466e893
......@@ -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);
......
......@@ -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 )
......
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