[PATCH 1/5] comctl32: Return if there's no current selection in TAB_EnsureSelectionVisible().

Henri Verbeet hverbeet at codeweavers.com
Mon Apr 25 15:54:11 CDT 2011


---
 dlls/comctl32/tab.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c
index a9a0548..bd34358 100644
--- a/dlls/comctl32/tab.c
+++ b/dlls/comctl32/tab.c
@@ -2440,6 +2440,9 @@ static void TAB_EnsureSelectionVisible(
   INT iSelected = infoPtr->iSelected;
   INT iOrigLeftmostVisible = infoPtr->leftmostVisible;
 
+  if (iSelected < 0)
+    return;
+
   /* set the items row to the bottommost row or topmost row depending on
    * style */
   if ((infoPtr->uNumRows > 1) && !(infoPtr->dwStyle & TCS_BUTTONS))
@@ -2504,7 +2507,7 @@ static void TAB_EnsureSelectionVisible(
 
   if (infoPtr->leftmostVisible >= iSelected)
   {
-    if (iSelected >= 0) infoPtr->leftmostVisible = iSelected;
+    infoPtr->leftmostVisible = iSelected;
   }
   else
   {
-- 
1.7.3.4




More information about the wine-patches mailing list