don't look up list items with negative index

svn path=/trunk/; revision=16385
This commit is contained in:
Thomas Bluemel
2005-07-03 02:02:47 +00:00
parent 79811989d8
commit 51e10671c0
+16 -13
View File
@@ -63,17 +63,20 @@ FindCheckItemByIndex(IN PCHECKLISTWND infoPtr,
{
PCHECKITEM Item, Found = NULL;
for (Item = infoPtr->CheckItemListHead;
Item != NULL;
Item = Item->Next)
if (Index >= 0)
{
if (Index == 0)
for (Item = infoPtr->CheckItemListHead;
Item != NULL;
Item = Item->Next)
{
Found = Item;
break;
if (Index == 0)
{
Found = Item;
break;
}
Index--;
}
Index--;
}
return Found;
@@ -1281,11 +1284,6 @@ CheckListWndProc(IN HWND hwnd,
pt.x = (LONG)LOWORD(lParam);
pt.y = (LONG)HIWORD(lParam);
if (!infoPtr->HasFocus)
{
SetFocus(hwnd);
}
NewFocus = PtToCheckItemBox(infoPtr,
&pt,
&NewFocusBox,
@@ -1321,6 +1319,11 @@ CheckListWndProc(IN HWND hwnd,
NewFocus,
NewFocusBox);
}
if (!infoPtr->HasFocus)
{
SetFocus(hwnd);
}
}
break;
}