* Fixed references to sub components (mantis #18021)

git-svn-id: trunk@16448 -
This commit is contained in:
michael 2010-11-26 14:51:43 +00:00
parent 11399b9b13
commit fa0454afe2

View File

@ -859,7 +859,7 @@ var
StrValue, DefStrValue: String; StrValue, DefStrValue: String;
UStrValue, UDefStrValue: UnicodeString; UStrValue, UDefStrValue: UnicodeString;
AncestorObj: TObject; AncestorObj: TObject;
Component: TComponent; C,Component: TComponent;
ObjValue: TObject; ObjValue: TObject;
SavedAncestor: TPersistent; SavedAncestor: TPersistent;
SavedPropPath, Name: String; SavedPropPath, Name: String;
@ -1080,19 +1080,28 @@ begin
if (ObjValue <> AncestorObj) if (ObjValue <> AncestorObj)
and not (csTransient in Component.ComponentStyle) then and not (csTransient in Component.ComponentStyle) then
begin begin
{ Determine the correct name of the component this property contains } Name:= '';
if Component.Owner = LookupRoot then C:= Component;
Name := Component.Name While (C<>Nil) and (C.Name<>'') do
else if Component = LookupRoot then begin
Name := 'Owner' If (Name<>'') Then
else if Assigned(Component.Owner) and (Length(Component.Owner.Name) > 0) Name:='.'+Name;
and (Length(Component.Name) > 0) then if C.Owner = LookupRoot then
Name := Component.Owner.Name + '.' + Component.Name begin
else if Length(Component.Name) > 0 then Name := C.Name+Name;
Name := Component.Name + '.Owner' break;
else end
SetLength(Name, 0); else if C = LookupRoot then
begin
Name := 'Owner' + Name;
break;
end;
Name:=C.Name + Name;
C:= C.Owner;
end;
if (C=nil) and (Component.Owner=nil) then
if (Name<>'') then //foreign root
Name:=Name+'.Owner';
if Length(Name) > 0 then if Length(Name) > 0 then
begin begin
Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name); Driver.BeginProperty(FPropPath + PPropInfo(PropInfo)^.Name);