mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 06:49:34 +02:00
IDEIntf: OI: implemented checking for circles in nested object properties, feature 11333
git-svn-id: trunk@15193 -
This commit is contained in:
parent
f2fa3c549d
commit
177dcdbe22
@ -1702,10 +1702,24 @@ begin
|
||||
end;
|
||||
|
||||
function TOICustomPropertyGrid.CanExpandRow(Row: TOIPropertyGridRow): boolean;
|
||||
var
|
||||
AnObject: TObject;
|
||||
ParentRow: TOIPropertyGridRow;
|
||||
begin
|
||||
Result:=false;
|
||||
if (Row=nil) or (Row.Editor=nil) then exit;
|
||||
if (not (paSubProperties in Row.Editor.GetAttributes)) then exit;
|
||||
// check if circling
|
||||
if (Row.Editor is TPersistentPropertyEditor) then begin
|
||||
AnObject:=Row.Editor.GetObjectValue;
|
||||
ParentRow:=Row.Parent;
|
||||
while ParentRow<>nil do begin
|
||||
if (ParentRow.Editor is TPersistentPropertyEditor)
|
||||
and (ParentRow.Editor.GetObjectValue=AnObject) then
|
||||
exit;
|
||||
ParentRow:=ParentRow.Parent;
|
||||
end;
|
||||
end;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user