xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r768320 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/table/ActiveCell.java status.xml test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
Date Fri, 24 Apr 2009 14:27:49 GMT
Author: vhennebert
Date: Fri Apr 24 14:27:49 2009
New Revision: 768320

URL: http://svn.apache.org/viewvc?rev=768320&view=rev
Log:
Bugfix: footnotes occurring within the forced height of a table row did not appear on the
output


Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
  (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java?rev=768320&r1=768319&r2=768320&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java Fri Apr
24 14:27:49 2009
@@ -19,12 +19,13 @@
 
 package org.apache.fop.layoutmgr.table;
 
-import java.util.LinkedList;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.ListIterator;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.flow.table.ConditionalBorder;
 import org.apache.fop.fo.flow.table.EffRow;
@@ -77,6 +78,14 @@
 
     private int spanIndex = 0;
 
+    /**
+     * The list of active footnotes. Those are the footnotes from the next step
+     * that is due to be merged by TableStepper.
+     *
+     * @see {@link #addFootnotes(List)}
+     */
+    private List footnotes;
+
     private Step previousStep;
     private Step nextStep;
     /**
@@ -102,8 +111,6 @@
         private int penaltyLength;
         /** Value of the penalty ending this step, 0 if the step does not end on a penalty.
*/
         private int penaltyValue;
-        /** List of footnotes for this step. */
-        private List footnoteList;
         /**
          * One of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
          * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
@@ -133,7 +140,6 @@
             this.totalLength   = other.totalLength;
             this.penaltyLength = other.penaltyLength;
             this.penaltyValue  = other.penaltyValue;
-            this.footnoteList  = other.footnoteList;
             this.condBeforeContentLength = other.condBeforeContentLength;
             this.breakClass    = other.breakClass;
         }
@@ -297,7 +303,6 @@
         afterNextStep.penaltyValue = 0;
         afterNextStep.condBeforeContentLength = 0;
         afterNextStep.breakClass = Constants.EN_AUTO;
-        afterNextStep.footnoteList = null;
         boolean breakFound = false;
         boolean prevIsBox = false;
         boolean boxFound = false;
@@ -328,10 +333,10 @@
                 prevIsBox = false;
             } else {
                 if (el instanceof KnuthBlockBox && ((KnuthBlockBox) el).hasAnchors())
{
-                    if (afterNextStep.footnoteList == null) {
-                        afterNextStep.footnoteList = new LinkedList();
+                    if (footnotes == null) {
+                        footnotes = new ArrayList();
                     }
-                    afterNextStep.footnoteList.addAll(((KnuthBlockBox) el).getFootnoteBodyLMs());
+                    footnotes.addAll(((KnuthBlockBox) el).getFootnoteBodyLMs());
                 }
                 prevIsBox = true;
                 boxFound = true;
@@ -561,8 +566,9 @@
      * @param footnoteList the list to which this cell must add its footnotes
      */
     void addFootnotes(List footnoteList) {
-        if (includedInLastStep() && nextStep.footnoteList != null) {
-            footnoteList.addAll(nextStep.footnoteList);
+        if (includedInLastStep() && footnotes != null) {
+            footnoteList.addAll(footnotes);
+            footnotes.clear();
         }
     }
 

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=768320&r1=768319&r2=768320&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Apr 24 14:27:49 2009
@@ -58,6 +58,10 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="VH" type="fix">
+        Bugfix: footnotes occurring within the forced height of a table row did not appear
on the 
+        output
+      </action>
       <action context="Renderers" dev="JM" type="update" fixes-bug="47031" due-to="Francois
Fernandes">
         PDFGraphics2D.writeClip doesn't generate a clip command anymore when the clip path
         is empty. 

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml?rev=768320&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
(added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
Fri Apr 24 14:27:49 2009
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks that a footnote within the fixed height of a table row is properly
handled.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple" page-height="220pt" page-width="3in"
+          margin="10pt">
+          <fo:region-body background-color="#F0F0F0"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="simple" font-size="8pt" line-height="10pt">
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block>Before the table</fo:block>
+          <fo:table table-layout="fixed" width="100%">
+            <fo:table-column column-width="proportional-column-width(1)"/>
+            <fo:table-column column-width="proportional-column-width(1)"/>
+            <fo:table-body border="1pt solid black">
+              <fo:table-row border="inherit" height="40pt">
+                <fo:table-cell border="inherit">
+                  <fo:block>Cell 1.1</fo:block>
+                  <fo:block>Cell 1.1</fo:block>
+                  <fo:block>Cell 1.1</fo:block>
+                </fo:table-cell>
+                <fo:table-cell border="inherit">
+                  <fo:block>Cell 1.2<fo:footnote>
+                      <fo:inline>(1)</fo:inline>
+                      <fo:footnote-body>
+                        <fo:block>(1) Footnote within the fixed height.</fo:block>
+                      </fo:footnote-body>
+                    </fo:footnote></fo:block>
+                  <fo:block>Cell 1.2</fo:block>
+                  <fo:block>Cell 1.2</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="1" xpath="count(//pageSequence[1]//footnote/block)"/>
+    <eval expected="(1) Footnote within the fixed height." xpath="//pageSequence[1]//footnote/block[1]"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_in_table_fixed-height.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message