Browse Source

* Original patch of Pascal Riekenberg to replace previous one

git-svn-id: trunk@37500 -
michael 7 years ago
parent
commit
42ac9457a2
1 changed files with 17 additions and 16 deletions
  1. 17 16
      packages/fcl-report/src/fpreport.pp

+ 17 - 16
packages/fcl-report/src/fpreport.pp

@@ -10750,6 +10750,8 @@ end;
 
 
 function TFPReportLayouter.ShowBandWithChilds(aBand: TFPReportCustomBand): Boolean;
 function TFPReportLayouter.ShowBandWithChilds(aBand: TFPReportCustomBand): Boolean;
 
 
+
+
 Var
 Var
   lHandledBands: TBandList;
   lHandledBands: TBandList;
   overFlowActions : TOverFlowActions;
   overFlowActions : TOverFlowActions;
@@ -10772,27 +10774,26 @@ begin
       lBand := aBand;
       lBand := aBand;
       while Assigned(lBand) do
       while Assigned(lBand) do
       begin
       begin
-        Exclude(overFlowActions,oaSameBandAgain);
-        lRTBand := CommonRuntimeBandProcessing(lBand);
-        Result := lRTBand<>Nil;
-        if Result then
-          begin
+        try
+          Exclude(overFlowActions,oaSameBandAgain);
+          lRTBand := CommonRuntimeBandProcessing(lBand);
+          if lRTBand=Nil then
+            Continue;
+          Result := True;
           lHandledBands.Add(lRTBand);
           lHandledBands.Add(lRTBand);
           UpdateSpaceRemaining(lRTBand, aBand.NeedsUpdateYPos);
           UpdateSpaceRemaining(lRTBand, aBand.NeedsUpdateYPos);
           if NoSpaceRemaining then
           if NoSpaceRemaining then
             overFlowActions := HandleOverflowedBands(lHandledBands, aBand, lRTBand);
             overFlowActions := HandleOverflowedBands(lHandledBands, aBand, lRTBand);
           if (oaStartAgain in overFlowActions) then
           if (oaStartAgain in overFlowActions) then
-            lband:=Nil // exit while loop.
-          else
-            begin
-            if Assigned(lRTBand) then
-              aBand.AfterPrintBand(Self, lRTBand);
-            if not (oaSameBandAgain in overFlowActions) then
-              lBand := lBand.ChildBand;
-            end;
-          end;
-        if (overFlowActions<>[]) then
-          Report.FRTIsOverflowed := True;
+            break;
+          if Assigned(lRTBand) then
+            aBand.AfterPrintBand(Self, lRTBand);
+        finally
+          if not (oaSameBandAgain in overFlowActions) then
+            lBand := lBand.ChildBand;
+          if (overFlowActions<>[]) then
+            Report.FRTIsOverflowed := True;
+        end;
       end; { while Assigned(lBand) }
       end; { while Assigned(lBand) }
     Until not (oaStartAgain in OverFlowActions);
     Until not (oaStartAgain in OverFlowActions);
     if (aBand is TFPReportCustomGroupHeaderBand) and
     if (aBand is TFPReportCustomGroupHeaderBand) and