From 177dcdbe2265f956dffbd77cd9526a5b1c00ea94 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 21 May 2008 11:48:02 +0000 Subject: [PATCH] IDEIntf: OI: implemented checking for circles in nested object properties, feature 11333 git-svn-id: trunk@15193 - --- ideintf/objectinspector.pp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ideintf/objectinspector.pp b/ideintf/objectinspector.pp index 17574dbe37..4285f0e7fc 100644 --- a/ideintf/objectinspector.pp +++ b/ideintf/objectinspector.pp @@ -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;