Avoid infinite loop in WINPOS_FindIconPos if the width of the parent

client area is less than the icon spacing.
This commit is contained in:
Huw D M Davies 1999-12-25 22:51:19 +00:00 committed by Alexandre Julliard
parent c64ec4a9d8
commit be89816eef
1 changed files with 4 additions and 2 deletions

View File

@ -136,7 +136,8 @@ static POINT16 WINPOS_FindIconPos( WND* wndPtr, POINT16 pt )
y = rectParent.bottom;
for (;;)
{
for (x = rectParent.left; x <= rectParent.right-xspacing; x += xspacing)
x = rectParent.left;
do
{
/* Check if another icon already occupies this spot */
WND *childPtr = WIN_LockWndPtr(wndPtr->parent->child);
@ -159,7 +160,8 @@ static POINT16 WINPOS_FindIconPos( WND* wndPtr, POINT16 pt )
pt.y = y - (yspacing + GetSystemMetrics(SM_CYICON)) / 2;
return pt;
}
}
x += xspacing;
} while(x <= rectParent.right-xspacing);
y -= yspacing;
}
}