mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 16:29:38 +02:00
IdeIntf: Improve locking of TObjectInspectorDlg.SetSelection.
git-svn-id: trunk@52236 -
This commit is contained in:
parent
e692bb38fe
commit
2b97e8c1c4
@ -738,7 +738,7 @@ type
|
||||
procedure DoZOrderItemClick(Sender: TObject);
|
||||
private
|
||||
FEnableHookGetSelection: boolean;
|
||||
FInSelection: Boolean;
|
||||
FSettingSelectionCount: integer;
|
||||
FRefreshingSelectionCount: integer;
|
||||
FOnAutoShow: TNotifyEvent;
|
||||
FLastActiveRowName: String;
|
||||
@ -4628,15 +4628,17 @@ end;
|
||||
|
||||
procedure TObjectInspectorDlg.SetSelection(const ASelection: TPersistentSelectionList);
|
||||
begin
|
||||
if ASelection<>nil then begin
|
||||
if FSelection.IsEqual(ASelection) then // Nothing changed or endless loop -> quit.
|
||||
if FInSelection or not ASelection.ForceUpdate then exit;
|
||||
end else begin
|
||||
if FSelection.Count=0 then exit;
|
||||
end;
|
||||
Assert(not FInSelection, 'TObjectInspectorDlg.SetSelection: Already setting selection.');
|
||||
FInSelection := True;
|
||||
if FSettingSelectionCount > 0 then Exit; // Prevent a recursive loop.
|
||||
Inc(FSettingSelectionCount);
|
||||
try
|
||||
if ASelection<>nil then begin
|
||||
// Nothing changed or endless loop -> quit.
|
||||
if FSelection.IsEqual(ASelection) and not ASelection.ForceUpdate then
|
||||
Exit;
|
||||
end else begin
|
||||
if FSelection.Count=0 then
|
||||
Exit;
|
||||
end;
|
||||
// ToDo: Clear filter only if a selected node is hidden (Visible=False)
|
||||
CompFilterEdit.Filter:='';
|
||||
if ASelection<>nil then
|
||||
@ -4648,7 +4650,7 @@ begin
|
||||
if Assigned(FOnSelectPersistentsInOI) then
|
||||
FOnSelectPersistentsInOI(Self);
|
||||
finally
|
||||
FInSelection := False;
|
||||
Dec(FSettingSelectionCount);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user