* Fix bug #33246, renaming a component does not change name in report structure

git-svn-id: trunk@57391 -
This commit is contained in:
michael 2018-02-27 13:56:08 +00:00
parent 1fae39afbd
commit a1e3dfbbca

View File

@ -49,6 +49,7 @@ type
procedure SetNodeProps(N: TTreeNode; E: TComponent);
procedure SetReport(AValue: TFPReport);
procedure SetSRT(AValue: Boolean);
procedure UpdateReportTree;
Protected
Property IgnoreSelectionChange : Boolean Read FISC Write FISC;
public
@ -156,8 +157,26 @@ begin
OnSelectElement(Self,C);
end;
procedure TObjectInspectorFrame.UpdateReportTree;
Var
I: Integer;
E : TFPReportElement;
N : TTreeNode;
begin
For I:=0 to ObjectList.Count-1 do
begin
E:=ObjectList[i].Element;
N:=TVReport.Items.FindNodeWithData(E);
if Assigned(N) then
N.Text:=GetNodeNameForElement(E);
end;
end;
procedure TObjectInspectorFrame.PGReportModified(Sender: TObject);
begin
UpdateReportTree;
If Assigned(FOnModified) then
FOnModified(Self);
end;
@ -186,21 +205,20 @@ begin
IgnoreSelectionChange:=True;
BeginUpdate;
Clear;
if Assigned(FReport) then
if Not Assigned(FReport) then
exit;
PN:=AddChild(Nil,'Report');
SetNodeProps(PN,FReport);
For I:=0 to FReport.PageCount-1 do
begin
PN:=AddChild(Nil,'Report');
SetNodeProps(PN,FReport);
For I:=0 to FReport.PageCount-1 do
begin
S:=Format(SPage,[I+1]);
if (FReport.Pages[i].Name<>'') then
S:=S+': '+FReport.Pages[i].Name;
N:=AddChild(PN,S);
SetNodeProps(N,FReport.Pages[i]);
AddElementChildren(N,FReport.Pages[i]);
end;
PN.Expand(True);
S:=Format(SPage,[I+1]);
if (FReport.Pages[i].Name<>'') then
S:=S+': '+FReport.Pages[i].Name;
N:=AddChild(PN,S);
SetNodeProps(N,FReport.Pages[i]);
AddElementChildren(N,FReport.Pages[i]);
end;
PN.Expand(True);
finally
EndUpdate;
IgnoreSelectionChange:=False;