mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 19:09:35 +02:00
TShellTreeView: fix crash if ObjectTypes is changed at runtime. Issue #40766.
This commit is contained in:
parent
0f3f955e2b
commit
1b2d06b80d
@ -674,9 +674,10 @@ begin
|
|||||||
CurrPath := GetPath;
|
CurrPath := GetPath;
|
||||||
try
|
try
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
Refresh(nil);
|
//Refresh(nil);
|
||||||
if Exists(CurrPath) then
|
//if Exists(CurrPath) then
|
||||||
SetPath(CurrPath);
|
// SetPath(CurrPath);
|
||||||
|
UpdateView;
|
||||||
finally
|
finally
|
||||||
EndUpdate;
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
@ -1393,7 +1394,12 @@ begin
|
|||||||
if not (otNonFolders in FObjectTypes) then
|
if not (otNonFolders in FObjectTypes) then
|
||||||
Result := ((Attr and faDirectory) > 0)
|
Result := ((Attr and faDirectory) > 0)
|
||||||
else
|
else
|
||||||
Result := True;
|
begin
|
||||||
|
if not (otHidden in FObjectTypes) then
|
||||||
|
Result := ((Attr and faHidden) = 0)
|
||||||
|
else
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
{$ifdef debug_shellctrls}
|
{$ifdef debug_shellctrls}
|
||||||
debugln(['TCustomShellTreeView.SetPath.Exists: Result = ',Result]);
|
debugln(['TCustomShellTreeView.SetPath.Exists: Result = ',Result]);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
Loading…
Reference in New Issue
Block a user