xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r627576 - in /xmlgraphics/fop/trunk: ./ src/java/org/apache/fop/fo/ src/java/org/apache/fop/fo/flow/table/ src/java/org/apache/fop/layoutmgr/table/ test/layoutengine/standard-testcases/
Date Wed, 13 Feb 2008 20:10:07 GMT
Author: vhennebert
Date: Wed Feb 13 12:10:01 2008
New Revision: 627576

URL: http://svn.apache.org/viewvc?rev=627576&view=rev
Log:
Moved to the FO tree stage the check for break-before/after on table-row while spanning in
progress, and fixed bug #44321 as well

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
    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-row_break-inside-span.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java Wed Feb 13 12:10:01 2008
@@ -360,7 +360,7 @@
      * (e.g., currently unsupported properties)
      * @param problem text to display that indicates the problem
      */
-    protected void attributeWarning(String problem) {
+    public void attributeWarning(String problem) {
         log.warn(warningText(locator) + getName() + ", " + problem);
     }
 

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/FixedColRowGroupBuilder.java
Wed Feb 13 12:10:01 2008
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.ListIterator;
 
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.ValidationException;
 
 
@@ -115,7 +116,24 @@
     }
 
     /** {@inheritDoc} */
-    void endRow(TableCellContainer container) {
+    void endRow(TableRow row) {
+        if (currentRowIndex > 0 && row.getBreakBefore() != Constants.EN_AUTO)
{
+            row.attributeWarning("break-before ignored because of row spanning "
+                    + "in progress (See XSL 1.1, 7.20.2)");
+        }
+        if (currentRowIndex < rows.size() - 1 && row.getBreakAfter() != Constants.EN_AUTO)
{
+            row.attributeWarning("break-after ignored because of row spanning "
+                    + "in progress (See XSL 1.1, 7.20.1)");
+        }
+        handleRowEnd(row);
+    }
+
+    /** {@inheritDoc} */
+    void endRow(TableBody body) {
+        handleRowEnd(body);
+    }
+
+    private void handleRowEnd(TableCellContainer container) {
         List currentRow = (List) rows.get(currentRowIndex);
         lastRow = currentRow;
         // Fill gaps with empty grid units

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/RowGroupBuilder.java Wed Feb
13 12:10:01 2008
@@ -58,12 +58,23 @@
     /**
      * Receives notification of the end of the current row. If the current row finishes
      * the row group, the {@link TableBody#addRowGroup(List)} method of the parent table
-     * part (i.e., the given container itself or its parent if this is a table-row) will
-     * be called
+     * part will be called.
      * 
-     * @param container the parent element of the current row
+     * @param row the row being finished
      */
-    abstract void endRow(TableCellContainer container);
+    abstract void endRow(TableRow row);
+
+    /**
+     * Receives notification of the end of the current row, when the source contains no
+     * fo:table-row element. If the current row finishes the row group, the
+     * {@link TableBody#addRowGroup(List)} method of the given table part will be called.
+     * 
+     * <p>If the source does contain explicit fo:table-row elements, then the
+     * {@link #endRow(TableRow)} method will be called instead.</p>
+     * 
+     * @param part the part containing the current row
+     */
+    abstract void endRow(TableBody part);
 
     /**
      * Receives notification of the start of a table-header/footer/body.

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
Wed Feb 13 12:10:01 2008
@@ -73,10 +73,19 @@
     }
 
     /** {@inheritDoc} */
-    void endRow(final TableCellContainer container) {
+    void endRow(final TableRow row) {
         events.add(new Event() {
             public void play(RowGroupBuilder rowGroupBuilder) {
-                rowGroupBuilder.endRow(container);
+                rowGroupBuilder.endRow(row);
+            }
+        });
+    }
+
+    /** {@inheritDoc} */
+    void endRow(final TableBody part) {
+        events.add(new Event() {
+            public void play(RowGroupBuilder rowGroupBuilder) {
+                rowGroupBuilder.endRow(part);
             }
         });
     }

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=627576&r1=627575&r2=627576&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 Wed Feb
13 12:10:01 2008
@@ -26,11 +26,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.fop.fo.Constants;
-import org.apache.fop.fo.FONode;
 import org.apache.fop.fo.flow.table.EffRow;
 import org.apache.fop.fo.flow.table.GridUnit;
 import org.apache.fop.fo.flow.table.PrimaryGridUnit;
-import org.apache.fop.fo.flow.table.TableRow;
 import org.apache.fop.layoutmgr.BreakElement;
 import org.apache.fop.layoutmgr.KnuthBox;
 import org.apache.fop.layoutmgr.KnuthGlue;
@@ -456,20 +454,8 @@
      */
     private void prepareNextRow() {
         if (activeRowIndex < rowGroup.length - 1) {
-            TableRow rowFO = rowGroup[activeRowIndex].getTableRow();
-            if (rowFO != null && rowFO.getBreakAfter() != Constants.EN_AUTO) {
-                log.warn(FONode.decorateWithContextInfo(
-                        "break-after ignored on table-row because of row spanning "
-                        + "in progress (See XSL 1.0, 7.19.1)", rowFO));
-            }
             previousRowsLength += rowGroup[activeRowIndex].getHeight().opt;
             activateCells(nextActiveCells, activeRowIndex + 1);
-            rowFO = rowGroup[activeRowIndex + 1].getTableRow();
-            if (rowFO != null && rowFO.getBreakBefore() != Constants.EN_AUTO) {
-                log.warn(FONode.decorateWithContextInfo(
-                        "break-before ignored on table-row because of row spanning "
-                        + "in progress (See XSL 1.0, 7.19.2)", rowFO));
-            }
             if (log.isTraceEnabled()) {
                 log.trace("Computing first step for row " + (activeRowIndex + 2));
             }

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Wed Feb 13 12:10:01 2008
@@ -28,6 +28,10 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Layout" dev="VH" type="fix" fixes-bug="44321">
+        Moved to the FO tree stage the check for break-before/after on table-row while spanning
in
+        progress.
+      </action>
       <action context="Layout" dev="VH" type="add">
         Added full support for breaks before and after table cells (that is, break-before/after
set
         on the first/last child of a cell).

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-row_break-inside-span.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-row_break-inside-span.xml?rev=627576&r1=627575&r2=627576&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-row_break-inside-span.xml
(original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table-row_break-inside-span.xml
Wed Feb 13 12:10:01 2008
@@ -20,7 +20,7 @@
   <info>
     <p>
       This test checks breaks on tables. Breaks on table-row during row spanning are ignored
-      (XSL 1.0, 7.19.1 and 7.19.2).
+      (XSL 1.1, 7.20.1 and 7.20.2).
     </p>
   </info>
   <fo>
@@ -33,10 +33,10 @@
       <fo:page-sequence master-reference="normal" white-space-collapse="true">
         <fo:flow flow-name="xsl-region-body">
           <fo:table table-layout="fixed" width="100%">
-            <fo:table-column/>
-            <fo:table-column/>
+            <fo:table-column column-width="proportional-column-width(1)"
+              number-columns-repeated="2"/>
             <fo:table-body>
-              <fo:table-row>
+              <fo:table-row break-after="page">
                 <fo:table-cell number-rows-spanned="2" background-color="orange">
                   <fo:block>cell1 line 1</fo:block>
                   <fo:block>cell1 line 2</fo:block>



---------------------------------------------------------------------
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