浏览代码

* Fix checkbox not saving/loading expression

git-svn-id: trunk@38809 -
michael 7 年之前
父节点
当前提交
642967520f
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 15 1
      packages/fcl-report/src/fpreport.pp

+ 15 - 1
packages/fcl-report/src/fpreport.pp

@@ -2087,7 +2087,8 @@ type
   Protected
     FTestResult: Boolean;
     Procedure   RecalcLayout; override;
-    Function PrepareObject(aRTParent: TFPReportElement): TFPReportElement; override;
+    Procedure   DoWriteLocalProperties(AWriter: TFPReportStreamer; AOriginal: TFPReportElement=nil); override;
+    Function    PrepareObject(aRTParent: TFPReportElement): TFPReportElement; override;
     property    Expression: TFPReportString read FExpression write SetExpression;
   public
     constructor Create(AOwner: TComponent); override;
@@ -2099,6 +2100,7 @@ type
     Function    CreatePropertyHash: String; override;
     procedure   Assign(Source: TPersistent); override;
     procedure   WriteElement(AWriter: TFPReportStreamer; AOriginal: TFPReportElement = nil); override;
+    Procedure   ReadElement(AReader: TFPReportStreamer); override;
     Property    TrueImageID : Integer Read FTrueImageID Write FTrueImageID;
     Property    FalseImageID : Integer Read FFalseImageID Write FFalseImageID;
   end;
@@ -5497,6 +5499,12 @@ begin
   // Do nothing
 end;
 
+procedure TFPReportCustomCheckbox.DoWriteLocalProperties(AWriter: TFPReportStreamer; AOriginal: TFPReportElement);
+begin
+  inherited DoWriteLocalProperties(AWriter, AOriginal);
+  AWriter.WriteString('Expression',Expression);
+end;
+
 function TFPReportCustomCheckbox.PrepareObject(aRTParent: TFPReportElement): TFPReportElement;
 
 Var
@@ -5597,6 +5605,12 @@ begin
   end;
 end;
 
+procedure TFPReportCustomCheckbox.ReadElement(AReader: TFPReportStreamer);
+begin
+  inherited ReadElement(AReader);
+  Expression:=AReader.ReadString('Expression','');
+end;
+
 
 { TFPReportUserData }