Commit 5ce31867 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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

parent d16bed15
...@@ -2440,6 +2440,9 @@ static void TAB_EnsureSelectionVisible( ...@@ -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( ...@@ -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
{ {
......
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