mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 15:36:01 +02:00
LazControls: fix potential crash in TListFilterEdit and TTreeFilterEdit, issue #21756, patch from Denis
git-svn-id: trunk@36778 -
This commit is contained in:
parent
33b839ba02
commit
8e7a33a863
@ -173,6 +173,8 @@ var
|
||||
s: string;
|
||||
clb: TCustomCheckListBox;
|
||||
begin
|
||||
if fFilteredListbox = nil then
|
||||
exit;
|
||||
clb:=Nil;
|
||||
if fFilteredListbox is TCustomCheckListBox then
|
||||
clb:=TCustomCheckListBox(fFilteredListbox);
|
||||
@ -197,6 +199,8 @@ procedure TListFilterEdit.StoreSelection;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if fFilteredListbox = nil then
|
||||
exit;
|
||||
fSelectionList.Clear;
|
||||
if fFilteredListbox.SelCount > 0 then
|
||||
for i := 0 to fFilteredListbox.Count-1 do
|
||||
|
@ -438,8 +438,10 @@ procedure TTreeFilterEdit.ApplyFilterCore;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
if fFilteredTreeview = nil then
|
||||
exit;
|
||||
fFilteredTreeview.BeginUpdate;
|
||||
if Assigned(fBranches) then begin // Apply filter for the brances
|
||||
if Assigned(fBranches) then begin // Apply filter for the branches
|
||||
for i:=0 to fBranches.Count-1 do
|
||||
fBranches[i].ApplyFilter;
|
||||
end
|
||||
@ -459,6 +461,8 @@ var
|
||||
ANode: TTreeNode;
|
||||
begin
|
||||
fSelectionList.Clear;
|
||||
if fFilteredTreeview = nil then
|
||||
exit;
|
||||
ANode:=fFilteredTreeview.Selected;
|
||||
while ANode<>nil do begin
|
||||
fSelectionList.Insert(0,ANode.Text);
|
||||
|
Loading…
Reference in New Issue
Block a user