user32: Fix side effect in SubtractRect().

This commit is contained in:
Javier Cantero 2014-03-20 16:07:32 +01:00 committed by Alexandre Julliard
parent 7a7925c872
commit 1f15169f72
1 changed files with 6 additions and 2 deletions

View File

@ -1421,14 +1421,14 @@ BOOL WINAPI SubtractRect( LPRECT dest, const RECT *src1, const RECT *src2 )
SetRectEmpty( dest );
return FALSE;
}
*dest = *src1;
if (IntersectRect( &tmp, src1, src2 ))
{
if (EqualRect( &tmp, dest ))
if (EqualRect( &tmp, src1 ))
{
SetRectEmpty( dest );
return FALSE;
}
*dest = *src1;
if ((tmp.top == dest->top) && (tmp.bottom == dest->bottom))
{
if (tmp.left == dest->left) dest->left = tmp.right;
@ -1440,6 +1440,10 @@ BOOL WINAPI SubtractRect( LPRECT dest, const RECT *src1, const RECT *src2 )
else if (tmp.bottom == dest->bottom) dest->bottom = tmp.top;
}
}
else
{
*dest = *src1;
}
return TRUE;
}