mirror of
https://github.com/reactos/reactos.git
synced 2025-07-23 02:43:38 +00:00
improve the genlist code a bit further
svn path=/trunk/; revision=31961
This commit is contained in:
parent
d06204ede8
commit
7fd698ea9a
1 changed files with 19 additions and 5 deletions
|
@ -21,6 +21,7 @@
|
|||
* FILE: subsys/system/usetup/genlist.c
|
||||
* PURPOSE: Generic list functions
|
||||
* PROGRAMMER: Eric Kohl
|
||||
* Christoph von Wittich <christoph at reactos.org>
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
@ -318,17 +319,30 @@ GenericListKeyPress (PGENERIC_LIST GenericList, CHAR AsciChar)
|
|||
PGENERIC_LIST_ENTRY ListEntry;
|
||||
PLIST_ENTRY Entry;
|
||||
|
||||
Entry = GenericList->ListHead.Flink;
|
||||
Entry = &GenericList->CurrentEntry->Entry;
|
||||
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
|
||||
Reset:
|
||||
|
||||
if (tolower(ListEntry->Text[0]) != AsciChar)
|
||||
Entry = GenericList->ListHead.Flink;
|
||||
|
||||
while (Entry != &GenericList->ListHead)
|
||||
{
|
||||
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
if (strlen(ListEntry->Text) > 0)
|
||||
if ((strlen(ListEntry->Text) > 0) && (tolower(ListEntry->Text[0]) == AsciChar))
|
||||
{
|
||||
if (tolower(ListEntry->Text[0]) == AsciChar)
|
||||
if (CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry) == GenericList->CurrentEntry)
|
||||
{
|
||||
GenericList->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
break;
|
||||
Entry = Entry->Flink;
|
||||
if (Entry == &GenericList->ListHead)
|
||||
goto Reset;
|
||||
ListEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
if ((strlen(ListEntry->Text) < 1) || (tolower(ListEntry->Text[0]) != AsciChar))
|
||||
goto Reset;
|
||||
}
|
||||
GenericList->CurrentEntry = CONTAINING_RECORD (Entry, GENERIC_LIST_ENTRY, Entry);
|
||||
break;
|
||||
}
|
||||
Entry = Entry->Flink;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue