* Fix bug ID #33286

git-svn-id: trunk@57435 -
This commit is contained in:
michael 2018-03-03 11:42:52 +00:00
parent 2cc5ce2d65
commit dc047b034f

View File

@ -995,8 +995,7 @@ begin
else
begin
StopDesigning;
FreeAndNil(FReport);
Report:=TFPReport.Create(Self);
ResetReport;
p:=gBandFactory.PageClass.Create(FReport);
p.PageSize.PaperName := 'A4';
p.Margins.Left := 20;
@ -1344,6 +1343,18 @@ begin
CurrentDesigner.Objects.ResizeSelection(saNone,0.0,TSizeAdjust((Sender as TACtion).Tag),0.0);
end;
procedure TFPReportDesignerForm.ResetReport;
begin
if Assigned(FReport) and (FReport.Owner=Self) then
begin
FreeAndNil(FReport);
FReport := TFPReport.Create(Self);
end
else
FReport.Clear;
end;
procedure TFPReportDesignerForm.LoadDesignFromFile(const AFilename: string);
var
rs: TFPReportJSONStreamer;
@ -1364,8 +1375,7 @@ begin
FreeAndNil(fs);
end;
StopDesigning;
FreeAndNil(FReport);
FReport := TFPReport.Create(Self);
ResetReport;
errs:=nil;
rs := TFPReportJSONStreamer.Create(nil);
rs.JSON := lJSON; // rs takes ownership of lJSON