]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Replace the array of forced breaks with a single boolean, which should be enough.
authorVincent Hennebert <vhennebert@apache.org>
Wed, 18 Apr 2007 08:46:58 +0000 (08:46 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Wed, 18 Apr 2007 08:46:58 +0000 (08:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@529920 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/TableStepper.java

index 589d00b8ffefe24e49e26380949b48ac528b1811..1415c628ad06c210060e52412cc0835d1b9ec5c4 100644 (file)
@@ -85,7 +85,7 @@ public class TableStepper {
     private boolean rowBacktrackForLastStep;
     private boolean skippedStep;
     private boolean[] keepWithNextSignals;
-    private boolean[] forcedBreaks;
+    private boolean forcedBreak;
     private int lastMaxPenaltyLength;
     
     /**
@@ -115,21 +115,15 @@ public class TableStepper {
         borderAfter = new int[columnCount];
         paddingAfter = new int[columnCount];
         keepWithNextSignals = new boolean[columnCount];
-        forcedBreaks = new boolean[columnCount];
         Arrays.fill(end, -1);
     }
     
     private void clearBreakCondition() {
-        Arrays.fill(forcedBreaks, false);
+        forcedBreak = false;
     }
     
     private boolean isBreakCondition() {
-        for (int i = 0; i < columnCount; i++) {
-            if (forcedBreaks[i]) {
-                return true;
-            }
-        }
-        return false;
+        return forcedBreak;
     }
     
     /**
@@ -220,7 +214,6 @@ public class TableStepper {
             widths[column] = 0;
             startRow[column] = activeRowIndex;
             keepWithNextSignals[column] = false;
-            forcedBreaks[column] = false;
         } else if (gu.isPrimary()) {
             PrimaryGridUnit pgu = (PrimaryGridUnit)gu;
             boolean makeBoxForWholeRow = false;
@@ -266,7 +259,6 @@ public class TableStepper {
             widths[column] = 0;
             startRow[column] = activeRowIndex;
             keepWithNextSignals[column] = false;
-            forcedBreaks[column] = false;
         }
     }
 
@@ -536,7 +528,7 @@ public class TableStepper {
                     this.lastMaxPenaltyLength = Math.max(this.lastMaxPenaltyLength, el.getW());
                     if (el.getP() <= -KnuthElement.INFINITE) {
                         log.debug("FORCED break encountered!");
-                        forcedBreaks[i] = true;
+                        forcedBreak = true;
                         break;
                     } else if (el.getP() < KnuthElement.INFINITE) {
                         //First legal break point