comctl32: Return if there's no current selection in TAB_EnsureSelectionVisible().

This commit is contained in:
Henri Verbeet 2011-04-25 22:54:11 +02:00 committed by Alexandre Julliard
parent d16bed15b6
commit 5ce3186735
1 changed files with 4 additions and 1 deletions

View File

@ -2440,6 +2440,9 @@ static void TAB_EnsureSelectionVisible(
INT iSelected = infoPtr->iSelected; INT iSelected = infoPtr->iSelected;
INT iOrigLeftmostVisible = infoPtr->leftmostVisible; INT iOrigLeftmostVisible = infoPtr->leftmostVisible;
if (iSelected < 0)
return;
/* set the items row to the bottommost row or topmost row depending on /* set the items row to the bottommost row or topmost row depending on
* style */ * style */
if ((infoPtr->uNumRows > 1) && !(infoPtr->dwStyle & TCS_BUTTONS)) if ((infoPtr->uNumRows > 1) && !(infoPtr->dwStyle & TCS_BUTTONS))
@ -2504,7 +2507,7 @@ static void TAB_EnsureSelectionVisible(
if (infoPtr->leftmostVisible >= iSelected) if (infoPtr->leftmostVisible >= iSelected)
{ {
if (iSelected >= 0) infoPtr->leftmostVisible = iSelected; infoPtr->leftmostVisible = iSelected;
} }
else else
{ {