Browse Source

* Patch from Pascal Riekenberg to fix HasAggregate for functions

git-svn-id: trunk@37057 -
michael 8 years ago
parent
commit
6e308feb60
1 changed files with 32 additions and 0 deletions
  1. 32 0
      packages/fcl-base/src/fpexprpars.pp

+ 32 - 0
packages/fcl-base/src/fpexprpars.pp

@@ -567,6 +567,9 @@ Type
     Procedure Check; override;
     Constructor CreateFunction(AID : TFPExprIdentifierDef; Const Args : TExprArgumentArray); virtual;
     Destructor Destroy; override;
+    Procedure InitAggregate; override;
+    Procedure UpdateAggregate; override;
+    Function HasAggregate : Boolean; override;
     Property ArgumentNodes : TExprArgumentArray Read FArgumentNodes;
     Property ArgumentParams : TExprParameterArray Read FArgumentParams;
     Function AsString : String; override;
@@ -3382,6 +3385,19 @@ begin
     end;
 end;
 
+function TFPExprFunction.HasAggregate: Boolean;
+var
+  I: Integer;
+begin
+  Result := true;
+  if IsAggregate then
+    exit;
+  For I:=0 to Length(FArgumentNodes)-1 do
+    if FArgumentNodes[I].HasAggregate then
+      exit;
+  Result := false;
+end;
+
 procedure TFPExprFunction.Check;
 
 Var
@@ -3428,6 +3444,22 @@ begin
   inherited Destroy;
 end;
 
+procedure TFPExprFunction.InitAggregate;
+var
+  I: Integer;
+begin
+  For I:=0 to Length(FArgumentNodes)-1 do
+    FArgumentNodes[i].InitAggregate;
+end;
+
+procedure TFPExprFunction.UpdateAggregate;
+var
+  I: Integer;
+begin
+  For I:=0 to Length(FArgumentNodes)-1 do
+    FArgumentNodes[i].UpdateAggregate;
+end;
+
 function TFPExprFunction.AsString: String;
 
 Var