Commit 1f15169f authored by Javier Cantero's avatar Javier Cantero Committed by Alexandre Julliard

user32: Fix side effect in SubtractRect().

parent 7a7925c8
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment