From 59834c98ec2cbdbdc339698a140709e06b73a3be Mon Sep 17 00:00:00 2001 From: zeljko Date: Thu, 7 Jun 2012 11:53:27 +0000 Subject: [PATCH] LCL: TCustomListView: reset FCacheIndex and FCacheItems before sorting list, otherwise we'll have unexpected results. issue #22218 git-svn-id: trunk@37564 - --- lcl/include/customlistview.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index 98783c50b9..c8b4940654 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -900,6 +900,9 @@ begin end; end; + Items.FCacheIndex := -1; + Items.FCacheItem := nil; + FListItems.FItems.Sort(@CompareItems); TWSCustomListViewClass(WidgetSetClass).SetSort(Self, FSortType, FSortColumn, FSortDirection);