comctl32/updown: Fix formatting for hex mode.
This commit is contained in:
parent
46194d39f6
commit
f897a91247
|
@ -309,7 +309,9 @@ static BOOL UPDOWN_GetBuddyInt (UPDOWN_INFO *infoPtr)
|
|||
*/
|
||||
static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
||||
{
|
||||
WCHAR fmt[3] = { '%', 'd', '\0' };
|
||||
static const WCHAR fmt_hex[] = { '0', 'x', '%', '0', '4', 'X', 0 };
|
||||
static const WCHAR fmt_dec_oct[] = { '%', 'd', '\0' };
|
||||
const WCHAR *fmt;
|
||||
WCHAR txt[20], txt_old[20] = { 0 };
|
||||
int len;
|
||||
|
||||
|
@ -324,7 +326,7 @@ static BOOL UPDOWN_SetBuddyInt (const UPDOWN_INFO *infoPtr)
|
|||
}
|
||||
|
||||
/* Regular window, so set caption to the number */
|
||||
if (infoPtr->Base == 16) fmt[1] = 'X';
|
||||
fmt = (infoPtr->Base == 16) ? fmt_hex : fmt_dec_oct;
|
||||
len = wsprintfW(txt, fmt, infoPtr->CurVal);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue