mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 18:42:14 +00:00
[USER32]
Don't fail if FillRect is called without brush. Fixes user32:uitools winetest svn path=/trunk/; revision=51178
This commit is contained in:
parent
54cac2ef9e
commit
f21acd6f09
1 changed files with 19 additions and 10 deletions
|
@ -1565,19 +1565,28 @@ INT WINAPI
|
|||
FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
||||
{
|
||||
HBRUSH prevhbr;
|
||||
BOOL Ret;
|
||||
|
||||
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
|
||||
/* Select brush if specified */
|
||||
if (hbr)
|
||||
{
|
||||
hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);
|
||||
/* Handle system colors */
|
||||
if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
|
||||
hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);
|
||||
|
||||
prevhbr = SelectObject(hDC, hbr);
|
||||
if (prevhbr == NULL)
|
||||
return (INT)FALSE;
|
||||
}
|
||||
if ((prevhbr = SelectObject(hDC, hbr)) == NULL)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
|
||||
lprc->bottom - lprc->top, PATCOPY);
|
||||
SelectObject(hDC, prevhbr);
|
||||
return TRUE;
|
||||
|
||||
Ret = PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
|
||||
lprc->bottom - lprc->top, PATCOPY);
|
||||
|
||||
/* Select old brush */
|
||||
if (hbr)
|
||||
SelectObject(hDC, prevhbr);
|
||||
|
||||
return (INT)Ret;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue