TCustomListView.GetNextItem never returns nil if search direction = sdAll and multiple items are selected
Original Reporter info from Mantis: sonata82 @sonata82
-
Reporter name: Remko Plantenga
Original Reporter info from Mantis: sonata82 @sonata82
- Reporter name: Remko Plantenga
Description:
According to the documentation, GetNextItem returns the next selected item for the current selected item. After all items have been enumerated, the function will return nil.
However, if multiple items are selected, the current implementation will always return another item and never return nil.
Steps to reproduce:
- Set MultiSelect property of a ListView to true
- Use the following simple example from the API documentation: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/GetNextItem_(Delphi)
- Item will never be nil and thus infinite loop
Additional information:
The attached example project re-creates the error. Just select both items from the list and click on the button.