From a21dad9e56ad96e9adc774d34ca7b8f6d96dd55d Mon Sep 17 00:00:00 2001 From: paul Date: Sat, 24 Jan 2009 10:12:43 +0000 Subject: [PATCH] lcl: return TListView.SelCount even if Handle is not allocated (bug #0011057) git-svn-id: trunk@18404 - --- lcl/include/customlistview.inc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lcl/include/customlistview.inc b/lcl/include/customlistview.inc index d42a0c56dd..2c6458429d 100644 --- a/lcl/include/customlistview.inc +++ b/lcl/include/customlistview.inc @@ -673,10 +673,18 @@ begin end; function TCustomListView.GetSelCount: Integer; +var + i: integer; begin if HandleAllocated then Result := TWSCustomListViewClass(WidgetSetClass).GetSelCount(Self) - else Result := 0; + else + begin + Result := 0; + for i := 0 to Items.Count - 1 do + if Items[i].Selected then + inc(Result); + end; end; {------------------------------------------------------------------------------