mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:03:00 +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)
|
FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
|
||||||
{
|
{
|
||||||
HBRUSH prevhbr;
|
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)
|
|
||||||
{
|
Ret = PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
|
||||||
return FALSE;
|
lprc->bottom - lprc->top, PATCOPY);
|
||||||
}
|
|
||||||
PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
|
/* Select old brush */
|
||||||
lprc->bottom - lprc->top, PATCOPY);
|
if (hbr)
|
||||||
SelectObject(hDC, prevhbr);
|
SelectObject(hDC, prevhbr);
|
||||||
return TRUE;
|
|
||||||
|
return (INT)Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue