mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 10:18:05 +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,
|
TWSCustomListViewClass(WidgetSetClass).ItemSetState(Self,
|
||||||
AItemIndex, Items[AItemIndex], lisSelected, True);
|
AItemIndex, Items[AItemIndex], lisSelected, True);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if FSavedChecked <> nil then
|
if FSavedChecked <> nil then
|
||||||
|
begin
|
||||||
|
for i := 0 to FSavedChecked.Count - 1 do
|
||||||
begin
|
begin
|
||||||
for i := 0 to FSavedChecked.Count - 1 do
|
FSavedCheckItem := TListItem( FSavedChecked[i] );
|
||||||
begin
|
// todo: this is inefficient, because FSavedCheckItem.Index must be called again
|
||||||
FSavedCheckItem := TListItem( FSavedChecked[i] );
|
TWSCustomListViewClass(WidgetSetClass).ItemSetChecked(Self,
|
||||||
// todo: this is inefficient, because FSavedCheckItem.Index must be called again
|
FSavedCheckItem.Index, FSavedCheckItem, True);
|
||||||
TWSCustomListViewClass(WidgetSetClass).ItemSetChecked(Self,
|
|
||||||
FSavedCheckItem.Index, FSavedCheckItem, True);
|
|
||||||
end;
|
|
||||||
FSavedChecked.Free;
|
|
||||||
end;
|
end;
|
||||||
|
FSavedChecked.Free;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
FreeThenNil(FSavedSelection);
|
FreeThenNil(FSavedSelection);
|
||||||
|
Loading…
Reference in New Issue
Block a user