mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 13:49:30 +02:00
lcl: don't change TListBox.ItemIndex or set selection based on ItemIndex for MultiSelect listbox on window recreation (bug #0016862)
git-svn-id: trunk@29133 -
This commit is contained in:
parent
5bb404e360
commit
c5100d475a
@ -32,7 +32,7 @@ type
|
||||
procedure TCustomListBox.AssignCacheToItemData(const AIndex: Integer;
|
||||
const AData: Pointer);
|
||||
begin
|
||||
if PCustomListBoxItemRecord(AData)^.Selected or (FItemIndex = AIndex) then
|
||||
if PCustomListBoxItemRecord(AData)^.Selected or (not MultiSelect and (FItemIndex = AIndex)) then
|
||||
begin
|
||||
LockSelectionChange;
|
||||
SendItemSelected(AIndex, True);
|
||||
@ -103,7 +103,8 @@ begin
|
||||
FItems := NewStrings;
|
||||
FCacheValid := False;
|
||||
|
||||
SendItemIndex;
|
||||
if FItemIndex <> TWSCustomListBoxClass(WidgetSetClass).GetItemIndex(Self) then
|
||||
SendItemIndex;
|
||||
|
||||
// copy items attributes
|
||||
cnt := OldItems.Count;
|
||||
@ -332,7 +333,7 @@ procedure TCustomListBox.SetMultiSelect(Val: Boolean);
|
||||
begin
|
||||
if Val <> FMultiSelect then
|
||||
begin
|
||||
FMultiSelect:= Val;
|
||||
FMultiSelect := Val;
|
||||
UpdateSelectionMode;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user