瀏覽代碼

* Ensure compilation with older versions of fpc

git-svn-id: trunk@38642 -
michael 7 年之前
父節點
當前提交
46ad7a206f

File diff suppressed because it is too large
+ 403 - 68
packages/fcl-report/src/fprepexprpars.pp


+ 3 - 3
packages/fcl-report/src/fpreport.pp

@@ -5580,7 +5580,7 @@ begin
     Inc(I);
     end;
   if (B=Nil) then
-    aErrors.Add(SErrDanglingChild,[Name]);
+    aErrors.Add(Format(SErrDanglingChild,[Name]));
 end;
 
 class function TFPReportCustomChildBand.ReportBandType: TFPReportBandType;
@@ -5785,7 +5785,7 @@ procedure TFPReportCustomGroupHeaderBand.Validate(aErrors: TStrings);
 begin
   inherited Validate(aErrors);
   If (GroupCondition='') then
-    aErrors.Add(SErrEmptyGroupExpression,[Name]);
+    aErrors.Add(Format(SErrEmptyGroupExpression,[Name]));
 end;
 
 procedure TFPReportCustomGroupHeaderBand.Assign(Source: TPersistent);
@@ -8849,7 +8849,7 @@ end;
 procedure TFPReportCustomBand.Validate(AErrors : TStrings);
 begin
   if (Page=Nil) then
-    aErrors.Add(SErrNoPageForBand,[Name]);
+    aErrors.Add(Format(SErrNoPageForBand,[Name]));
 end;
 
 procedure TFPReportCustomBand.WriteElement(AWriter: TFPReportStreamer; AOriginal: TFPReportElement);

+ 5 - 1
packages/fcl-report/src/fpreportcontnr.pp

@@ -180,7 +180,11 @@ begin
     begin
     PI:=GetPropInfo(O,AFieldName);
     if Assigned(PI) then
+      {$if FPC_FULLVERSION<=30000}
+      aValue:=GetPropValue(O,PI^.Name,True);
+      {$else}
       aValue:=GetPropValue(O,PI,True);
+      {$endif}
     end;
 end;
 
@@ -191,7 +195,7 @@ Const
   tkAllowed = tkProperties -
               [tkArray,tkRecord,tkInterface,tkClass,
                tkObject,tkDynArray,tkInterfaceRaw,tkProcVar,
-               tkHelper,tkFile,tkClassRef,tkPointer];
+               tkHelper{$if FPC_FULLVERSION>30000},tkFile,tkClassRef,tkPointer{$ENDIF}];
 
 Var
   C : TClass;

+ 1 - 1
packages/fcl-report/src/fpreportfpimageexport.pp

@@ -416,7 +416,7 @@ begin
     Canvas.TextOut(
         mmToPixels(lXPos),
         mmToPixels(lYPos),
-        txtblk.Text
+        {$if FPC_FULLVERSION>30000}txtblk.Text{$ELSE} UTF8Decode(txtblk.Text){$ENDIF}
     );
   end;
 end;

+ 2 - 2
packages/fcl-report/src/fpreporthtmlexport.pp

@@ -682,8 +682,8 @@ begin
         if (AElement.Frame.Shape=fsRectangle) or (FL in AElement.Frame.Lines) then
           begin
           Style.Add(ColorToStyle(Format('border-%s-color',[FNames[FL]]),AElement.Frame.Color));
-          Style.Add('border-%s-width: %dpx;',[FNames[FL],AElement.Frame.Width]);
-          Style.Add('border-%s-style: %s;',[FNames[FL],FStyles[AElement.Frame.Pen]]);
+          Style.Add(Format('border-%s-width: %dpx;',[FNames[FL],AElement.Frame.Width]));
+          Style.Add(Format('border-%s-style: %s;',[FNames[FL],FStyles[AElement.Frame.Pen]]));
           end;
       end;
     if AExtra<>'' then

+ 4 - 0
packages/fcl-report/src/fpreporthtmlutil.pp

@@ -464,7 +464,11 @@ Var
 begin
   if Not Assigned(FStyleContent) then
     begin
+    {$if FPC_FULLVERSION<30000}
+    aStyle.Delimiter:=' ';
+    {$else}
     aStyle.LineBreak:=' ';
+    {$ENDIF}
     AElement['style']:=aStyle.text
     end
   else

+ 9 - 0
packages/fcl-report/src/fpreportjson.pp

@@ -65,6 +65,12 @@ resourcestring
   SErrInvalidJSONAtPath = 'Invalid JSON at Path. Need Array or Object';
   SErrInvalidPath = 'Path "%s" is not valid';
 
+{$if FPC_FULLVERSION<30000}
+Const
+  StructuredJSONTypes  = [jtArray,jtObject];
+{$ENDIF}
+
+
 { TFPReportJSONData }
 
 function TFPReportJSONData.GetJSON: TJSONStringType;
@@ -77,6 +83,7 @@ end;
 
 procedure TFPReportJSONData.SetRoot;
 
+
 Var
   d : TJSONData;
 
@@ -172,7 +179,9 @@ begin
       ntFloat : AValue:=D.AsFloat;
       ntInteger : AValue:=D.AsInteger;
       ntInt64 : AValue:=D.AsInt64;
+      {$if FPC_FULLVERSION>30000}
       ntQWord : AValue:=D.AsQWord;
+      {$ENDIF}
     end;
   jtBoolean:
     AValue:=D.AsBoolean;

+ 8 - 0
packages/fcl-report/src/fpreportstreamer.pp

@@ -238,7 +238,11 @@ end;
 
 procedure TFPReportJSONStreamer.WriteQWord(AName: String; AValue: QWord);
 begin
+ {$if FPC_FULLVERSION>30000}
  CurrentElement.Add(AName, AValue);
+ {$else}
+ CurrentElement.Add(AName, Int64(AValue));
+ {$endif} 
 end;
 
 procedure TFPReportJSONStreamer.WriteFloat(AName: String; AValue: Extended);
@@ -359,7 +363,11 @@ begin
   else
   begin
     if d.JSONType = jtNumber then
+{$if FPC_FULLVERSION>30000}    
       Result := d.AsQWord
+{$ELSE}      
+     Result := QWord(d.AsInt64)
+{$ENDIF}      
     else
       Result := ADefault;
   end;

Some files were not shown because too many files changed in this diff