From 92205aaf989fc56f3fc599a07aba68b875afa7ac Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Fri, 20 Apr 2001 18:29:45 +0000 Subject: [PATCH] Take a stab at implementing SetSolidBrush16. --- objects/brush.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/objects/brush.c b/objects/brush.c index 4b02632978f..fef82fb055e 100644 --- a/objects/brush.c +++ b/objects/brush.c @@ -400,16 +400,29 @@ INT BRUSH_GetObject( BRUSHOBJ * brush, INT count, LPSTR buffer ) /*********************************************************************** * SetSolidBrush16 (GDI.604) * - * If hBrush is a solid brush, change it's color to newColor. + * If hBrush is a solid brush, change its color to newColor. * * RETURNS * TRUE on success, FALSE on failure. - * FIXME: not yet implemented! + * + * FIXME: untested, not sure if correct. */ BOOL16 WINAPI SetSolidBrush16(HBRUSH16 hBrush, COLORREF newColor ) { - FIXME("(hBrush %04x, newColor %04x): stub!\n", hBrush, (int)newColor); + BRUSHOBJ * brushPtr; + BOOL16 res = FALSE; + + TRACE("(hBrush %04x, newColor %08lx)\n", hBrush, (DWORD)newColor); + if (!(brushPtr = (BRUSHOBJ *) GDI_GetObjPtr( hBrush, BRUSH_MAGIC ))) + return FALSE; + + if (brushPtr->logbrush.lbStyle == BS_SOLID) + { + brushPtr->logbrush.lbColor = newColor; + res = TRUE; + } - return(FALSE); + GDI_ReleaseObj( hBrush ); + return res; } -- 2.11.4.GIT