mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 21:39:12 +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;
|
s: string;
|
||||||
clb: TCustomCheckListBox;
|
clb: TCustomCheckListBox;
|
||||||
begin
|
begin
|
||||||
|
if fFilteredListbox = nil then
|
||||||
|
exit;
|
||||||
clb:=Nil;
|
clb:=Nil;
|
||||||
if fFilteredListbox is TCustomCheckListBox then
|
if fFilteredListbox is TCustomCheckListBox then
|
||||||
clb:=TCustomCheckListBox(fFilteredListbox);
|
clb:=TCustomCheckListBox(fFilteredListbox);
|
||||||
@ -197,6 +199,8 @@ procedure TListFilterEdit.StoreSelection;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
if fFilteredListbox = nil then
|
||||||
|
exit;
|
||||||
fSelectionList.Clear;
|
fSelectionList.Clear;
|
||||||
if fFilteredListbox.SelCount > 0 then
|
if fFilteredListbox.SelCount > 0 then
|
||||||
for i := 0 to fFilteredListbox.Count-1 do
|
for i := 0 to fFilteredListbox.Count-1 do
|
||||||
|
@ -438,8 +438,10 @@ procedure TTreeFilterEdit.ApplyFilterCore;
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
|
if fFilteredTreeview = nil then
|
||||||
|
exit;
|
||||||
fFilteredTreeview.BeginUpdate;
|
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
|
for i:=0 to fBranches.Count-1 do
|
||||||
fBranches[i].ApplyFilter;
|
fBranches[i].ApplyFilter;
|
||||||
end
|
end
|
||||||
@ -459,6 +461,8 @@ var
|
|||||||
ANode: TTreeNode;
|
ANode: TTreeNode;
|
||||||
begin
|
begin
|
||||||
fSelectionList.Clear;
|
fSelectionList.Clear;
|
||||||
|
if fFilteredTreeview = nil then
|
||||||
|
exit;
|
||||||
ANode:=fFilteredTreeview.Selected;
|
ANode:=fFilteredTreeview.Selected;
|
||||||
while ANode<>nil do begin
|
while ANode<>nil do begin
|
||||||
fSelectionList.Insert(0,ANode.Text);
|
fSelectionList.Insert(0,ANode.Text);
|
||||||
|
Loading…
Reference in New Issue
Block a user