mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 09:58:06 +02:00
LCL: fix a bug in ListView introduced @0e0ef8c where the checked state was not restored correctly after sorting.
This commit is contained in:
parent
d73ca45293
commit
25e632015e
@ -1144,19 +1144,18 @@ begin
|
||||
TWSCustomListViewClass(WidgetSetClass).ItemSetState(Self,
|
||||
AItemIndex, Items[AItemIndex], lisSelected, True);
|
||||
end;
|
||||
end;
|
||||
|
||||
if FSavedChecked <> nil then
|
||||
if FSavedChecked <> nil then
|
||||
begin
|
||||
for i := 0 to FSavedChecked.Count - 1 do
|
||||
begin
|
||||
for i := 0 to FSavedChecked.Count - 1 do
|
||||
begin
|
||||
FSavedCheckItem := TListItem( FSavedChecked[i] );
|
||||
// todo: this is inefficient, because FSavedCheckItem.Index must be called again
|
||||
TWSCustomListViewClass(WidgetSetClass).ItemSetChecked(Self,
|
||||
FSavedCheckItem.Index, FSavedCheckItem, True);
|
||||
end;
|
||||
FSavedChecked.Free;
|
||||
FSavedCheckItem := TListItem( FSavedChecked[i] );
|
||||
// todo: this is inefficient, because FSavedCheckItem.Index must be called again
|
||||
TWSCustomListViewClass(WidgetSetClass).ItemSetChecked(Self,
|
||||
FSavedCheckItem.Index, FSavedCheckItem, True);
|
||||
end;
|
||||
|
||||
FSavedChecked.Free;
|
||||
end;
|
||||
finally
|
||||
FreeThenNil(FSavedSelection);
|
||||
|
Loading…
Reference in New Issue
Block a user