You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2007/11/20 17:07:33 UTC
svn commit: r596727 - in /xmlgraphics/fop/trunk:
src/java/org/apache/fop/layoutmgr/table/TableStepper.java status.xml
test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml
Author: vhennebert
Date: Tue Nov 20 08:07:32 2007
New Revision: 596727
URL: http://svn.apache.org/viewvc?rev=596727&view=rev
Log:
Bugfix in tables: wrong element generation by the merging algorithm when glues must be produced to cope with conditional spaces. The corresponding length was added twice: one in the glue itself and one in the following box.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
xmlgraphics/fop/trunk/status.xml
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?rev=596727&r1=596726&r2=596727&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java Tue Nov 20 08:07:32 2007
@@ -156,15 +156,15 @@
boolean signalKeepWithNext = false;
int laststep = 0;
int step;
- int addedBoxLen = 0;
+ int cumulateLength = 0; // Length of the content accumulated before the break
TableContentPosition lastTCPos = null;
LinkedList returnList = new LinkedList();
while ((step = getNextStep()) >= 0) {
int normalRow = activeRowIndex;
int increase = step - laststep;
int penaltyOrGlueLen = step + getMaxRemainingHeight() - totalHeight;
- int boxLen = step - addedBoxLen - Math.max(0, penaltyOrGlueLen);
- addedBoxLen += boxLen;
+ int boxLen = step - cumulateLength - Math.max(0, penaltyOrGlueLen)/* the penalty, if any */;
+ cumulateLength += boxLen + Math.max(0, -penaltyOrGlueLen)/* the glue, if any */;
boolean forcedBreak = false;
int breakClass = -1;
Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=596727&r1=596726&r2=596727&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Tue Nov 20 08:07:32 2007
@@ -28,6 +28,11 @@
<changes>
<release version="FOP Trunk">
+ <action context="Code" dev="VH" type="fix">
+ Bugfix in tables: wrong element generation by the merging algorithm when glues must be
+ produced to cope with conditional spaces. The corresponding length was added twice: one in
+ the glue itself and one in the following box.
+ </action>
<action context="Code" dev="JM" type="fix">
Bugfix for URI resolution: Make StreamSources without system identifier work again.
</action>
@@ -35,8 +40,8 @@
Avoid a NullPointerException in AreaTreeHandler.endDocument().
</action>
<action context="Code" dev="VH" type="fix" fixes-bug="43766">
- Bugfix: breaks generated by the merging algorithm for a table-row containing empty cells had always a
- penalty of 900.
+ Bugfix: breaks generated by the merging algorithm for a table-row containing empty cells
+ had always a penalty of 900.
</action>
<action context="Code" dev="JM" type="add" fixes-bug="43605" due-to="V. Schappert">
Added methods for fo:page-number-citation(-last) in FOEventHandler.
Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml?rev=596727&r1=596726&r2=596727&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-cell_conditional-spaces_1.xml Tue Nov 20 08:07:32 2007
@@ -144,5 +144,16 @@
<eval expected="31800" xpath="//pageViewport[8]//flow/block[2]/block/@bpd"/>
<eval expected="16800" xpath="//pageViewport[9]//flow/block/@bpd"/>
<eval expected="16800" xpath="//pageViewport[9]//flow/block/block/@bpd"/>
+
+ <element-list category="breaker">
+ <skip>3</skip> <!-- The block before the table -->
+ <penalty p="INF" w="0"/>
+ <glue w="4000"/> <!-- The border before -->
+ <box w="16800"/> <!-- Line 1 -->
+ <penalty p="0" w="0"/>
+ <glue w="25000"/> <!-- The space between lines -->
+ <box w="16800"/> <!-- Line 2 -->
+ <skip>3</skip> <!-- glue for end of page TODO missing element for border-after!! -->
+ </element-list>
</checks>
</testcase>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org