aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/fo/flow/Table.java10
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java16
2 files changed, 21 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/fo/flow/Table.java b/src/java/org/apache/fop/fo/flow/Table.java
index d82a14631..15b402fa6 100644
--- a/src/java/org/apache/fop/fo/flow/Table.java
+++ b/src/java/org/apache/fop/fo/flow/Table.java
@@ -179,6 +179,16 @@ public class Table extends FObj {
public TableBody getTableFooter() {
return tableFooter;
}
+
+ /** @return true if the table-header should be omitted at breaks */
+ public boolean omitHeaderAtBreak() {
+ return (this.tableOmitHeaderAtBreak == EN_TRUE);
+ }
+
+ /** @return true if the table-footer should be omitted at breaks */
+ public boolean omitFooterAtBreak() {
+ return (this.tableOmitFooterAtBreak == EN_TRUE);
+ }
/**
* @return the "inline-progression-dimension" property.
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
index 0a2a767de..c2778fce7 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
@@ -57,6 +57,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
private List bodyBreaks = new java.util.ArrayList();
private BreakPoss headerBreak;
private BreakPoss footerBreak;
+ private boolean firstRowHandled = false;
private int referenceIPD;
private boolean autoLayout = true;
@@ -185,13 +186,17 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
//Calculate the headers and footers only when needed
MinOptMax headerSize = null;
if (getTable().getTableHeader() != null) {
- Body tableHeader = new Body(getTable().getTableHeader());
- tableHeader.setParent(this);
- headerBreak = getHeight(tableHeader, context);
- headerSize = headerBreak.getStackingSize();
- stackSize.add(headerSize);
+ if (!getTable().omitHeaderAtBreak() || !firstRowHandled) {
+ Body tableHeader = new Body(getTable().getTableHeader());
+ tableHeader.setParent(this);
+ headerBreak = getHeight(tableHeader, context);
+ headerSize = headerBreak.getStackingSize();
+ stackSize.add(headerSize);
+ }
}
+ //TODO Implement table-omit-footer-at-break once the page breaking
+ //is improved, so we don't have to do this twice
MinOptMax footerSize = null;
if (getTable().getTableFooter() != null) {
Body tableFooter = new Body(getTable().getTableFooter());
@@ -244,6 +249,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
stackSize.add(bp.getStackingSize());
lastPos = bp;
bodyBreaks.add(bp);
+ firstRowHandled = true;
if (bp.nextBreakOverflows()) {
over = true;