diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2008-06-22 09:07:47 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2008-06-22 09:07:47 +0000 |
commit | 72c8655231d048d4c01ea77ca3277d1334e839db (patch) | |
tree | f726e979e5df74737ed4a1dad79e859659488a89 /src/java/org/apache/fop/fo/flow/table | |
parent | 435d77401e1514c7713689e4da348f6856e22ac0 (diff) | |
download | xmlgraphics-fop-72c8655231d048d4c01ea77ca3277d1334e839db.tar.gz xmlgraphics-fop-72c8655231d048d4c01ea77ca3277d1334e839db.zip |
Addition to r670217
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@670323 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/table')
4 files changed, 34 insertions, 47 deletions
diff --git a/src/java/org/apache/fop/fo/flow/table/TableBody.java b/src/java/org/apache/fop/fo/flow/table/TableBody.java index ee5024240..c3cf772ac 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableBody.java +++ b/src/java/org/apache/fop/fo/flow/table/TableBody.java @@ -20,6 +20,7 @@ package org.apache.fop.fo.flow.table; import org.apache.fop.fo.FONode; +import org.apache.fop.apps.FOPException; /** * Class modelling the <a href="http://www.w3.org/TR/xsl/#fo_table-body"> @@ -36,4 +37,28 @@ public class TableBody extends TablePart { super(parent); } + /** {@inheritDoc} */ + public void startOfNode() throws FOPException { + super.startOfNode(); + getFOEventHandler().startBody(this); + } + + /** {@inheritDoc} */ + public void endOfNode() throws FOPException { + super.endOfNode(); + getFOEventHandler().endBody(this); + } + + /** {@inheritDoc} */ + public String getLocalName() { + return "table-body"; + } + + /** + * {@inheritDoc} + * @return {@link org.apache.fop.fo.Constants#FO_TABLE_BODY} + */ + public int getNameId() { + return FO_TABLE_BODY; + } } diff --git a/src/java/org/apache/fop/fo/flow/table/TableFooter.java b/src/java/org/apache/fop/fo/flow/table/TableFooter.java index 8f166b321..886001e76 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableFooter.java +++ b/src/java/org/apache/fop/fo/flow/table/TableFooter.java @@ -43,15 +43,13 @@ public class TableFooter extends TablePart { /** {@inheritDoc} */ public void startOfNode() throws FOPException { super.startOfNode(); + getFOEventHandler().startFooter(this); } /** {@inheritDoc} */ public void endOfNode() throws FOPException { - if (!(tableRowsFound || tableCellsFound)) { - missingChildElementError("marker* (table-row+|table-cell+)"); - } else { - finishLastRowGroup(); - } + super.endOfNode(); + getFOEventHandler().endFooter(this); } /** {@inheritDoc} */ diff --git a/src/java/org/apache/fop/fo/flow/table/TableHeader.java b/src/java/org/apache/fop/fo/flow/table/TableHeader.java index 5939fba73..c42d79b46 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableHeader.java +++ b/src/java/org/apache/fop/fo/flow/table/TableHeader.java @@ -42,15 +42,13 @@ public class TableHeader extends TablePart { /** {@inheritDoc} */ public void startOfNode() throws FOPException { super.startOfNode(); + getFOEventHandler().startHeader(this); } /** {@inheritDoc} */ public void endOfNode() throws FOPException { - if (!(tableRowsFound || tableCellsFound)) { - missingChildElementError("marker* (table-row+|table-cell+)"); - } else { - finishLastRowGroup(); - } + super.endOfNode(); + getFOEventHandler().endHeader(this); } /** {@inheritDoc} */ diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java index 677a7a17c..67af69e03 100644 --- a/src/java/org/apache/fop/fo/flow/table/TablePart.java +++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java @@ -58,9 +58,6 @@ public abstract class TablePart extends TableCellContainer { private boolean lastCellEndsRow = true; - /** The last encountered table-row. */ - private TableRow lastRow; - private List rowGroups = new LinkedList(); /** @@ -82,6 +79,7 @@ public abstract class TablePart extends TableCellContainer { public void processNode(String elementName, Locator locator, Attributes attlist, PropertyList pList) throws FOPException { + if (!inMarker()) { Table t = getTable(); if (t.hasExplicitColumns()) { @@ -96,35 +94,17 @@ public abstract class TablePart extends TableCellContainer { columnNumberManager = new ColumnNumberManager(); } super.processNode(elementName, locator, attlist, pList); - } - /** {@inheritDoc} */ - public void startOfNode() throws FOPException { - super.startOfNode(); - if (this instanceof TableHeader) { - getFOEventHandler().startHeader((TableHeader)this); - } else if (this instanceof TableFooter) { - getFOEventHandler().startFooter((TableFooter)this); - } else { - getFOEventHandler().startBody((TableBody)this); - } } /** {@inheritDoc} */ public void endOfNode() throws FOPException { + super.endOfNode(); if (!inMarker()) { pendingSpans = null; columnNumberManager = null; } - if (this instanceof TableHeader) { - getFOEventHandler().endHeader((TableHeader)this); - } else if (this instanceof TableFooter) { - getFOEventHandler().endFooter((TableFooter)this); - } else { - getFOEventHandler().endBody((TableBody)this); - } - if (!(tableRowsFound || tableCellsFound)) { missingChildElementError("marker* (table-row+|table-cell+)", true); getParent().removeChild(this); @@ -198,8 +178,7 @@ public abstract class TablePart extends TableCellContainer { getTable().getRowGroupBuilder().endTableRow(); } rowsStarted = true; - lastRow = (TableRow) child; - getTable().getRowGroupBuilder().startTableRow(lastRow); + getTable().getRowGroupBuilder().startTableRow((TableRow)child); break; case FO_TABLE_CELL: if (!rowsStarted) { @@ -239,19 +218,6 @@ public abstract class TablePart extends TableCellContainer { return commonBorderPaddingBackground; } - /** {@inheritDoc} */ - public String getLocalName() { - return "table-body"; - } - - /** - * {@inheritDoc} - * @return {@link org.apache.fop.fo.Constants#FO_TABLE_BODY} - */ - public int getNameId() { - return FO_TABLE_BODY; - } - /** * @param obj table row in question * @return true if the given table row is the first row of this body. |