aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-02-11 10:45:24 +0000
committerJeremias Maerki <jeremias@apache.org>2005-02-11 10:45:24 +0000
commit47e43d9be9f76e2aac90754f8d2d1cb59e278d82 (patch)
tree8c016f4423586d0e5a47c6510a0d1b8473ecb21e /src/java/org
parent8aec6b9ed0421d17864c03636c2a977734da30b6 (diff)
downloadxmlgraphics-fop-47e43d9be9f76e2aac90754f8d2d1cb59e278d82.tar.gz
xmlgraphics-fop-47e43d9be9f76e2aac90754f8d2d1cb59e278d82.zip
Implemented table-omit-header-at-break. The same for footers comes later when page breaking is revisited.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198418 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-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;