View Issue Details

IDProjectCategoryView StatusLast Update
0032327FPCPatchpublic2017-08-24 16:54
ReporterGraeme GeldenhuysAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSFreeBSDOS Version10.3
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0032327: [patch] a set of patches for fpReport fixing various things
DescriptionAttached are 4 patches. Below is the things they fixe and units that got changed.

NOTE:
Regarding the Visibility Warnings patch. I made the Band and Page properties protected (where they were introduced). But I wasn't sure which classes needed those properties made Published, because apparently Pascal Riekenberg didn't want all classes to have them Published, so tried to incorrectly hide those properties.

====================================
  * fpreport: fixes compiler hint about unused units in fcldemo.pp
  * fpreport: remove stray text in the fcldemo.pp unit.
  * fpreport: Fix visibility warnings introduced in commit r37045.
  * fpreport: Fix compiler hints about unused variables or no return
    values set.

 packages/fcl-report/demos/fcldemo.pp | 6 ++---
 packages/fcl-report/src/fpreport.pp | 34 ++++++------------------
 packages/fcl-report/src/fpreportfpimageexport.pp | 1 -
 3 files changed, 10 insertions(+), 31 deletions(-)
====================================
TagsfpReport
Fixed in Revision37054
FPCOldBugId
FPCTarget
Attached Files
  • 0001-fpreport-fixes-compiler-hint-about-unused-units-in-f.patch (852 bytes)
    From 4e277c6fe3dd1eae80674e66522bc50f552eb267 Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Thu, 24 Aug 2017 14:05:25 +0100
    Subject: [PATCH 1/4] fpreport: fixes compiler hint about unused units in
     fcldemo.pp
    
    ---
     packages/fcl-report/demos/fcldemo.pp | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/packages/fcl-report/demos/fcldemo.pp b/packages/fcl-report/demos/fcldemo.pp
    index 5c055e0708..d8b7d33130 100644
    --- a/packages/fcl-report/demos/fcldemo.pp
    +++ b/packages/fcl-report/demos/fcldemo.pp
    @@ -1,9 +1,7 @@
     program fcldemo;
     
     uses
    -  udapp, regreports, rptcolumns, rptdataset, rptexpressions, rptframes,
    -  rptgrouping, rptimages, rptmasterdetail, rptmasterdetaildataset, rptshapes,
    -  rptsimplelist, rptttf;
    +  udapp, regreports;
     
     Var
       Application : TReportDemoApplication;
    -- 
    2.13.1
    
    
  • 0002-fpreport-remove-stray-text-in-the-fcldemo.pp-unit.patch (638 bytes)
    From aca69ee4abb91f0a38aaa669b84bec86af4c82b1 Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Thu, 24 Aug 2017 14:05:50 +0100
    Subject: [PATCH 2/4] fpreport: remove stray text in the fcldemo.pp unit.
    
    ---
     packages/fcl-report/demos/fcldemo.pp | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/packages/fcl-report/demos/fcldemo.pp b/packages/fcl-report/demos/fcldemo.pp
    index d8b7d33130..78b5d8a22b 100644
    --- a/packages/fcl-report/demos/fcldemo.pp
    +++ b/packages/fcl-report/demos/fcldemo.pp
    @@ -12,5 +12,5 @@
       Application.Run;
       Application.Free;
     end.
    -                   s
    +
     
    -- 
    2.13.1
    
    
  • 0003-fpreport-Fix-visibility-warnings-introduced-in-commi.patch (4,554 bytes)
    From 03a7788bd874bdf4ff17ee3872b52efaaa69de1f Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Thu, 24 Aug 2017 15:14:06 +0100
    Subject: [PATCH 3/4] fpreport: Fix visibility warnings introduced in commit
     r37045.
    
    You can't reduce visibility of properties or methods in descendant
    classes.
    ---
     packages/fcl-report/src/fpreport.pp | 24 ++++++------------------
     1 file changed, 6 insertions(+), 18 deletions(-)
    
    diff --git a/packages/fcl-report/src/fpreport.pp b/packages/fcl-report/src/fpreport.pp
    index 46e8e4f462..690a1f87c2 100644
    --- a/packages/fcl-report/src/fpreport.pp
    +++ b/packages/fcl-report/src/fpreport.pp
    @@ -594,10 +594,7 @@   TFPReportLayout = class(TFPReportCustomLayout)
       end;
     
     
    -  // Anything that must be drawn as part of the report descends from this.
    -
    -  { TFPReportElement }
    -
    +  { Anything that must be drawn as part of the report descends from this. }
       TFPReportElement = class(TFPReportComponent)
       private
         FFrame: TFPReportFrame;
    @@ -639,6 +636,8 @@   TFPReportElement = class(TFPReportComponent)
         procedure RecalcLayout; virtual; abstract;
         property  StretchMode: TFPReportStretchMode read FStretchMode write FStretchMode default smDontStretch;
         property  OnBeforePrint: TFPReportBeforePrintEvent read FOnBeforePrint write FOnBeforePrint;
    +    property Page: TFPReportCustomPage read GetReportPage;
    +    property Band: TFPReportCustomBand read GetReportBand;
       public
         constructor Create(AOwner: TComponent); override;
         destructor Destroy; override;
    @@ -659,13 +658,9 @@   TFPReportElement = class(TFPReportComponent)
         property Frame: TFPReportFrame read FFrame write SetFrame;
         property Visible: boolean read FVisible write SetVisible;
         property VisibleExpr: String read FVisibleExpr write SetVisibleExpr;
    -    property Page: TFPReportCustomPage read GetReportPage;
    -    property Band: TFPReportCustomBand read GetReportBand;
       end;
     
     
    -  { TFPReportElementWithChildren }
    -
       TFPReportElementWithChildren = class(TFPReportElement)
       private
         FChildren: TFPList;
    @@ -744,9 +739,6 @@   TFPReportPageSize = class(TPersistent)
         That means that top/left equals top/left margin
          Width/Height is equals to page height/width minus margins
          Page orientation is taken into consideration. }
    -
    -  { TFPReportCustomPage }
    -
       TFPReportCustomPage = class(TFPReportElementWithChildren)
       private
         FData: TFPReportData;
    @@ -773,11 +765,9 @@   TFPReportCustomPage = class(TFPReportElementWithChildren)
         procedure SetColumnLayout(AValue: TFPReportColumnLayout);
         procedure SetColumnCount(AValue: Byte);
         procedure SetColumnGap(AValue: TFPReportUnits);
    +  protected
         function GetReportPage: TFPReportCustomPage; override;
         function GetReportBand: TFPReportCustomBand; override;
    -    property Band;
    -    property Page;
    -  protected
         Procedure SaveDataToNames; override;
         Procedure RestoreDataFromNames; override;
         procedure RemoveChild(const AChild: TFPReportElement); override;
    @@ -792,7 +782,7 @@   TFPReportCustomPage = class(TFPReportElementWithChildren)
       public
         constructor Create(AOwner: TComponent); override;
         destructor  Destroy; override;
    -    Function  PageIndex : Integer;
    +    Function    PageIndex : Integer;
         procedure   Assign(Source: TPersistent); override;
         procedure   ReadElement(AReader: TFPReportStreamer); override;
         function    FindBand(ABand: TFPReportBandClass): TFPReportCustomBand;
    @@ -824,8 +814,6 @@   TFPReportPage = class(TFPReportCustomPage)
       end;
     
     
    -  { TFPReportCustomBand }
    -
       TFPReportCustomBand = class(TFPReportElementWithChildren)
       private
         FChildBand: TFPReportChildBand;
    @@ -833,7 +821,6 @@   TFPReportCustomBand = class(TFPReportElementWithChildren)
         FVisibleOnPage: TFPReportVisibleOnPage;
         FFont: TFPReportFont;
         function    GetFont: TFPReportFont;
    -    function    GetReportPage: TFPReportCustomPage; override;
         function    IsStringValueZero(const AValue: string): boolean;
         procedure   SetChildBand(AValue: TFPReportChildBand);
         procedure   ApplyStretchMode;
    @@ -841,6 +828,7 @@   TFPReportCustomBand = class(TFPReportElementWithChildren)
         procedure   SetUseParentFont(AValue: boolean);
         procedure   SetVisibleOnPage(AValue: TFPReportVisibleOnPage);
       protected
    +    function    GetReportPage: TFPReportCustomPage; override;
         function    GetReportBandName: string; virtual;
         function    GetData: TFPReportData; virtual;
         procedure   SetDataFromName(AName : String); virtual;
    -- 
    2.13.1
    
    
  • 0004-fpreport-Fix-compiler-hints-about-unused-variables-o.patch (2,367 bytes)
    From dc8c5257c34c80f36b185ce099582cf8eb52a248 Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Thu, 24 Aug 2017 15:14:47 +0100
    Subject: [PATCH 4/4] fpreport: Fix compiler hints about unused variables or no
     return values set.
    
    ---
     packages/fcl-report/src/fpreport.pp              | 10 ++--------
     packages/fcl-report/src/fpreportfpimageexport.pp |  1 -
     2 files changed, 2 insertions(+), 9 deletions(-)
    
    diff --git a/packages/fcl-report/src/fpreport.pp b/packages/fcl-report/src/fpreport.pp
    index 690a1f87c2..427250b5f4 100644
    --- a/packages/fcl-report/src/fpreport.pp
    +++ b/packages/fcl-report/src/fpreport.pp
    @@ -2614,6 +2614,7 @@ function TFPReportBandFactory.RegisterBandClass(aBandType: TFPReportBandType;
     function TFPReportBandFactory.RegisterPageClass(aClass: TFPReportCustomPageClass
       ): TFPReportCustomPageClass;
     begin
    +  Result := nil;  // TODO: Why is this a function if no Result is ever returned?
       If Not AClass.InheritsFrom(TFPReportCustomPage) then
         raise EReportError.CreateFmt(SErrPageClassMustDescendFrom, [
           TFPReportCustomPageClass.ClassName]);
    @@ -2663,13 +2664,9 @@ procedure TFPReportExportManager.UnRegisterExport(AClass: TFPReportExporterClass
         FList.Delete(i);
     end;
     
    -function TFPReportExportManager.ConfigExporter(AExporter: TFPReportExporter
    -  ): Boolean;
    -
    +function TFPReportExportManager.ConfigExporter(AExporter: TFPReportExporter): Boolean;
     Var
       H : TFPReportExporterConfigHandler;
    -  I : Integer;
    -
     begin
       H:=ExporterConfigHandler(TFPReportExporterClass(AExporter.ClassType));
       if (H=Nil) then
    @@ -6024,9 +6021,6 @@ procedure TFPReportCustomPage.Assign(Source: TPersistent);
     procedure TFPReportCustomPage.ReadElement(AReader: TFPReportStreamer);
     var
       E: TObject;
    -  N : String;
    -  D : TFPReportDataItem;
    -
     begin
       inherited ReadElement(AReader);
       E := AReader.FindChild('Margins');
    diff --git a/packages/fcl-report/src/fpreportfpimageexport.pp b/packages/fcl-report/src/fpreportfpimageexport.pp
    index 1b9dae3144..8ba137ed0d 100644
    --- a/packages/fcl-report/src/fpreportfpimageexport.pp
    +++ b/packages/fcl-report/src/fpreportfpimageexport.pp
    @@ -665,7 +665,6 @@ function TFPReportExportfpImage.SetupHTMLPageRender(const APage: TFPReportPage):
     
     Var
       PageDiv : THTMLElement;
    -  ImgEl : THTMLElement;
     
     begin
       Result:=ChangeFileExt(ImageFile,'.html');
    -- 
    2.13.1
    
    
  • 0005-fpreport-Fixes-2-memory-leaks-in-demo-application.patch (1,173 bytes)
    From 25e9c39de146f3c4f03bc989e2142752f7711c35 Mon Sep 17 00:00:00 2001
    From: Graeme Geldenhuys <graemeg@gmail.com>
    Date: Thu, 24 Aug 2017 15:31:50 +0100
    Subject: [PATCH 5/5] fpreport: Fixes 2 memory leaks in demo application.
    
    ---
     packages/fcl-report/demos/udapp.pp | 6 ++++--
     1 file changed, 4 insertions(+), 2 deletions(-)
    
    diff --git a/packages/fcl-report/demos/udapp.pp b/packages/fcl-report/demos/udapp.pp
    index a102b858ad..4af308f842 100644
    --- a/packages/fcl-report/demos/udapp.pp
    +++ b/packages/fcl-report/demos/udapp.pp
    @@ -331,8 +331,6 @@ procedure TReportDemoApplication.Usage(Msg : String);
       Writeln('');
       Writeln('Known demos for this binary: ');
       ListReports(True);
    -  Free;
    -  Halt(Ord(Msg<>''));
     end;
     
     procedure TReportDemoApplication.ListReports(AWithIndentation: boolean);
    @@ -421,7 +419,11 @@ procedure TReportDemoApplication.DoRun;
       OnGetApplicationName:=@GetReportAppName;
       S:=CheckOptions('lj::hf:r:d:',['list','json::','help','format:','runtime:','demo:']);
       if (S<>'') or HasOption('h','help') then
    +  begin
         Usage(S);
    +    Terminate;
    +    exit;
    +  end;
       if HasOption('l','list') then
         begin
         ListReports;
    -- 
    2.13.1
    
    

Activities

Graeme Geldenhuys

2017-08-24 16:21

reporter  

0001-fpreport-fixes-compiler-hint-about-unused-units-in-f.patch (852 bytes)
From 4e277c6fe3dd1eae80674e66522bc50f552eb267 Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Thu, 24 Aug 2017 14:05:25 +0100
Subject: [PATCH 1/4] fpreport: fixes compiler hint about unused units in
 fcldemo.pp

---
 packages/fcl-report/demos/fcldemo.pp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/packages/fcl-report/demos/fcldemo.pp b/packages/fcl-report/demos/fcldemo.pp
index 5c055e0708..d8b7d33130 100644
--- a/packages/fcl-report/demos/fcldemo.pp
+++ b/packages/fcl-report/demos/fcldemo.pp
@@ -1,9 +1,7 @@
 program fcldemo;
 
 uses
-  udapp, regreports, rptcolumns, rptdataset, rptexpressions, rptframes,
-  rptgrouping, rptimages, rptmasterdetail, rptmasterdetaildataset, rptshapes,
-  rptsimplelist, rptttf;
+  udapp, regreports;
 
 Var
   Application : TReportDemoApplication;
-- 
2.13.1

Graeme Geldenhuys

2017-08-24 16:21

reporter  

0002-fpreport-remove-stray-text-in-the-fcldemo.pp-unit.patch (638 bytes)
From aca69ee4abb91f0a38aaa669b84bec86af4c82b1 Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Thu, 24 Aug 2017 14:05:50 +0100
Subject: [PATCH 2/4] fpreport: remove stray text in the fcldemo.pp unit.

---
 packages/fcl-report/demos/fcldemo.pp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/packages/fcl-report/demos/fcldemo.pp b/packages/fcl-report/demos/fcldemo.pp
index d8b7d33130..78b5d8a22b 100644
--- a/packages/fcl-report/demos/fcldemo.pp
+++ b/packages/fcl-report/demos/fcldemo.pp
@@ -12,5 +12,5 @@
   Application.Run;
   Application.Free;
 end.
-                   s
+
 
-- 
2.13.1

Graeme Geldenhuys

2017-08-24 16:21

reporter  

0003-fpreport-Fix-visibility-warnings-introduced-in-commi.patch (4,554 bytes)
From 03a7788bd874bdf4ff17ee3872b52efaaa69de1f Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Thu, 24 Aug 2017 15:14:06 +0100
Subject: [PATCH 3/4] fpreport: Fix visibility warnings introduced in commit
 r37045.

You can't reduce visibility of properties or methods in descendant
classes.
---
 packages/fcl-report/src/fpreport.pp | 24 ++++++------------------
 1 file changed, 6 insertions(+), 18 deletions(-)

diff --git a/packages/fcl-report/src/fpreport.pp b/packages/fcl-report/src/fpreport.pp
index 46e8e4f462..690a1f87c2 100644
--- a/packages/fcl-report/src/fpreport.pp
+++ b/packages/fcl-report/src/fpreport.pp
@@ -594,10 +594,7 @@   TFPReportLayout = class(TFPReportCustomLayout)
   end;
 
 
-  // Anything that must be drawn as part of the report descends from this.
-
-  { TFPReportElement }
-
+  { Anything that must be drawn as part of the report descends from this. }
   TFPReportElement = class(TFPReportComponent)
   private
     FFrame: TFPReportFrame;
@@ -639,6 +636,8 @@   TFPReportElement = class(TFPReportComponent)
     procedure RecalcLayout; virtual; abstract;
     property  StretchMode: TFPReportStretchMode read FStretchMode write FStretchMode default smDontStretch;
     property  OnBeforePrint: TFPReportBeforePrintEvent read FOnBeforePrint write FOnBeforePrint;
+    property Page: TFPReportCustomPage read GetReportPage;
+    property Band: TFPReportCustomBand read GetReportBand;
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
@@ -659,13 +658,9 @@   TFPReportElement = class(TFPReportComponent)
     property Frame: TFPReportFrame read FFrame write SetFrame;
     property Visible: boolean read FVisible write SetVisible;
     property VisibleExpr: String read FVisibleExpr write SetVisibleExpr;
-    property Page: TFPReportCustomPage read GetReportPage;
-    property Band: TFPReportCustomBand read GetReportBand;
   end;
 
 
-  { TFPReportElementWithChildren }
-
   TFPReportElementWithChildren = class(TFPReportElement)
   private
     FChildren: TFPList;
@@ -744,9 +739,6 @@   TFPReportPageSize = class(TPersistent)
     That means that top/left equals top/left margin
      Width/Height is equals to page height/width minus margins
      Page orientation is taken into consideration. }
-
-  { TFPReportCustomPage }
-
   TFPReportCustomPage = class(TFPReportElementWithChildren)
   private
     FData: TFPReportData;
@@ -773,11 +765,9 @@   TFPReportCustomPage = class(TFPReportElementWithChildren)
     procedure SetColumnLayout(AValue: TFPReportColumnLayout);
     procedure SetColumnCount(AValue: Byte);
     procedure SetColumnGap(AValue: TFPReportUnits);
+  protected
     function GetReportPage: TFPReportCustomPage; override;
     function GetReportBand: TFPReportCustomBand; override;
-    property Band;
-    property Page;
-  protected
     Procedure SaveDataToNames; override;
     Procedure RestoreDataFromNames; override;
     procedure RemoveChild(const AChild: TFPReportElement); override;
@@ -792,7 +782,7 @@   TFPReportCustomPage = class(TFPReportElementWithChildren)
   public
     constructor Create(AOwner: TComponent); override;
     destructor  Destroy; override;
-    Function  PageIndex : Integer;
+    Function    PageIndex : Integer;
     procedure   Assign(Source: TPersistent); override;
     procedure   ReadElement(AReader: TFPReportStreamer); override;
     function    FindBand(ABand: TFPReportBandClass): TFPReportCustomBand;
@@ -824,8 +814,6 @@   TFPReportPage = class(TFPReportCustomPage)
   end;
 
 
-  { TFPReportCustomBand }
-
   TFPReportCustomBand = class(TFPReportElementWithChildren)
   private
     FChildBand: TFPReportChildBand;
@@ -833,7 +821,6 @@   TFPReportCustomBand = class(TFPReportElementWithChildren)
     FVisibleOnPage: TFPReportVisibleOnPage;
     FFont: TFPReportFont;
     function    GetFont: TFPReportFont;
-    function    GetReportPage: TFPReportCustomPage; override;
     function    IsStringValueZero(const AValue: string): boolean;
     procedure   SetChildBand(AValue: TFPReportChildBand);
     procedure   ApplyStretchMode;
@@ -841,6 +828,7 @@   TFPReportCustomBand = class(TFPReportElementWithChildren)
     procedure   SetUseParentFont(AValue: boolean);
     procedure   SetVisibleOnPage(AValue: TFPReportVisibleOnPage);
   protected
+    function    GetReportPage: TFPReportCustomPage; override;
     function    GetReportBandName: string; virtual;
     function    GetData: TFPReportData; virtual;
     procedure   SetDataFromName(AName : String); virtual;
-- 
2.13.1

Graeme Geldenhuys

2017-08-24 16:21

reporter  

0004-fpreport-Fix-compiler-hints-about-unused-variables-o.patch (2,367 bytes)
From dc8c5257c34c80f36b185ce099582cf8eb52a248 Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Thu, 24 Aug 2017 15:14:47 +0100
Subject: [PATCH 4/4] fpreport: Fix compiler hints about unused variables or no
 return values set.

---
 packages/fcl-report/src/fpreport.pp              | 10 ++--------
 packages/fcl-report/src/fpreportfpimageexport.pp |  1 -
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/packages/fcl-report/src/fpreport.pp b/packages/fcl-report/src/fpreport.pp
index 690a1f87c2..427250b5f4 100644
--- a/packages/fcl-report/src/fpreport.pp
+++ b/packages/fcl-report/src/fpreport.pp
@@ -2614,6 +2614,7 @@ function TFPReportBandFactory.RegisterBandClass(aBandType: TFPReportBandType;
 function TFPReportBandFactory.RegisterPageClass(aClass: TFPReportCustomPageClass
   ): TFPReportCustomPageClass;
 begin
+  Result := nil;  // TODO: Why is this a function if no Result is ever returned?
   If Not AClass.InheritsFrom(TFPReportCustomPage) then
     raise EReportError.CreateFmt(SErrPageClassMustDescendFrom, [
       TFPReportCustomPageClass.ClassName]);
@@ -2663,13 +2664,9 @@ procedure TFPReportExportManager.UnRegisterExport(AClass: TFPReportExporterClass
     FList.Delete(i);
 end;
 
-function TFPReportExportManager.ConfigExporter(AExporter: TFPReportExporter
-  ): Boolean;
-
+function TFPReportExportManager.ConfigExporter(AExporter: TFPReportExporter): Boolean;
 Var
   H : TFPReportExporterConfigHandler;
-  I : Integer;
-
 begin
   H:=ExporterConfigHandler(TFPReportExporterClass(AExporter.ClassType));
   if (H=Nil) then
@@ -6024,9 +6021,6 @@ procedure TFPReportCustomPage.Assign(Source: TPersistent);
 procedure TFPReportCustomPage.ReadElement(AReader: TFPReportStreamer);
 var
   E: TObject;
-  N : String;
-  D : TFPReportDataItem;
-
 begin
   inherited ReadElement(AReader);
   E := AReader.FindChild('Margins');
diff --git a/packages/fcl-report/src/fpreportfpimageexport.pp b/packages/fcl-report/src/fpreportfpimageexport.pp
index 1b9dae3144..8ba137ed0d 100644
--- a/packages/fcl-report/src/fpreportfpimageexport.pp
+++ b/packages/fcl-report/src/fpreportfpimageexport.pp
@@ -665,7 +665,6 @@ function TFPReportExportfpImage.SetupHTMLPageRender(const APage: TFPReportPage):
 
 Var
   PageDiv : THTMLElement;
-  ImgEl : THTMLElement;
 
 begin
   Result:=ChangeFileExt(ImageFile,'.html');
-- 
2.13.1

Graeme Geldenhuys

2017-08-24 16:31

reporter  

0005-fpreport-Fixes-2-memory-leaks-in-demo-application.patch (1,173 bytes)
From 25e9c39de146f3c4f03bc989e2142752f7711c35 Mon Sep 17 00:00:00 2001
From: Graeme Geldenhuys <graemeg@gmail.com>
Date: Thu, 24 Aug 2017 15:31:50 +0100
Subject: [PATCH 5/5] fpreport: Fixes 2 memory leaks in demo application.

---
 packages/fcl-report/demos/udapp.pp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/packages/fcl-report/demos/udapp.pp b/packages/fcl-report/demos/udapp.pp
index a102b858ad..4af308f842 100644
--- a/packages/fcl-report/demos/udapp.pp
+++ b/packages/fcl-report/demos/udapp.pp
@@ -331,8 +331,6 @@ procedure TReportDemoApplication.Usage(Msg : String);
   Writeln('');
   Writeln('Known demos for this binary: ');
   ListReports(True);
-  Free;
-  Halt(Ord(Msg<>''));
 end;
 
 procedure TReportDemoApplication.ListReports(AWithIndentation: boolean);
@@ -421,7 +419,11 @@ procedure TReportDemoApplication.DoRun;
   OnGetApplicationName:=@GetReportAppName;
   S:=CheckOptions('lj::hf:r:d:',['list','json::','help','format:','runtime:','demo:']);
   if (S<>'') or HasOption('h','help') then
+  begin
     Usage(S);
+    Terminate;
+    exit;
+  end;
   if HasOption('l','list') then
     begin
     ListReports;
-- 
2.13.1

Graeme Geldenhuys

2017-08-24 16:32

reporter   ~0102348

Added a 5th patch that fixes 2 memory leaks in the demo application of fpReport.

Michael Van Canneyt

2017-08-24 16:54

administrator   ~0102349

Applied, thank you very much!

Issue History

Date Modified Username Field Change
2017-08-24 16:21 Graeme Geldenhuys New Issue
2017-08-24 16:21 Graeme Geldenhuys File Added: 0001-fpreport-fixes-compiler-hint-about-unused-units-in-f.patch
2017-08-24 16:21 Graeme Geldenhuys File Added: 0002-fpreport-remove-stray-text-in-the-fcldemo.pp-unit.patch
2017-08-24 16:21 Graeme Geldenhuys File Added: 0003-fpreport-Fix-visibility-warnings-introduced-in-commi.patch
2017-08-24 16:21 Graeme Geldenhuys File Added: 0004-fpreport-Fix-compiler-hints-about-unused-variables-o.patch
2017-08-24 16:21 Graeme Geldenhuys Tag Attached: fpReport
2017-08-24 16:31 Graeme Geldenhuys File Added: 0005-fpreport-Fixes-2-memory-leaks-in-demo-application.patch
2017-08-24 16:32 Graeme Geldenhuys Note Added: 0102348
2017-08-24 16:54 Michael Van Canneyt Fixed in Revision => 37054
2017-08-24 16:54 Michael Van Canneyt Note Added: 0102349
2017-08-24 16:54 Michael Van Canneyt Status new => resolved
2017-08-24 16:54 Michael Van Canneyt Fixed in Version => 3.1.1
2017-08-24 16:54 Michael Van Canneyt Resolution open => fixed
2017-08-24 16:54 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-08-24 16:54 Michael Van Canneyt Target Version => 3.2.0