* Fix bug #33395, preserve name when loading

git-svn-id: trunk@57482 -
This commit is contained in:
michael 2018-03-09 08:37:51 +00:00
parent 6aad5cc192
commit f33cec8ed8
2 changed files with 8 additions and 1 deletions

View File

@ -882,6 +882,7 @@ Var
O : TReportObject;
begin
D:=Default(TRect);
Result:=TFPList.Create;
try
For I:=0 to Count-1 do
@ -911,6 +912,7 @@ Var
begin
BL:=Nil;
D:=Default(TRect);
Result:=TFPList.Create;
try
try

View File

@ -344,6 +344,7 @@ Var
begin
With TSaveDialog.Create(Application) do
try
DefaultExt:='.json';
Filter:='Report files|*.json|All files'+AllFilesMask;
Options:=[ofPathMustExist];
If Execute then
@ -363,20 +364,24 @@ procedure TFPReportComponentEditor.LoadReport;
Var
J : TFPJSONReport;
N : String;
begin
With TOpenDialog.Create(Application) do
try
DefaultExt:='.json';
Filter:='Report files|*.json|All files'+AllFilesMask;
Options:=[ofFileMustExist];
If Execute then
If Component is TFPJSONReport then
begin
N:=J.Name;
J:=Component as TFPJSONReport;
J.LoadFromFile(FileName);
J.DesignTimeJSON.Clear;
J.SavetoJSON(J.DesignTimeJSON);
end;;
J.Name:=N;
end;
finally
Free;
end;