aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-09-15 14:29:42 +0000
committerJeremias Maerki <jeremias@apache.org>2005-09-15 14:29:42 +0000
commit4a939c5502e95f891ed92181d4cdf7865cbeb092 (patch)
tree4d8eed305bc8858624d571d0484c45728c4a5f4e
parent4db852f5154fc44b3aea755eb1a562379713c964 (diff)
downloadxmlgraphics-fop-4a939c5502e95f891ed92181d4cdf7865cbeb092.tar.gz
xmlgraphics-fop-4a939c5502e95f891ed92181d4cdf7865cbeb092.zip
Bugfix for table_width.xml. Table width was not determined correctly when specified explicitely and indents are present.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@289245 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
index 713d0179a..f0084e737 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
@@ -59,7 +59,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager
private Block curBlockArea;
- private int referenceIPD;
+ private int contentIPD;
private int referenceBPD;
private boolean autoLayout = true;
@@ -125,15 +125,20 @@ public class TableLayoutManager extends BlockStackingLayoutManager
referenceIPD = context.getRefIPD();
if (fobj.getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) {
- referenceIPD = fobj.getInlineProgressionDimension().getOptimum(this).getLength().getValue(this);
- } else if( !fobj.isAutoLayout() ) {
- log.info("table-layout=\"fixed\" and width=\"auto\", but auto-layout not supported " +
- "=> assuming width=\"100%\"");
+ referenceIPD = fobj.getInlineProgressionDimension().getOptimum(this)
+ .getLength().getValue(this);
+ contentIPD = referenceIPD;
+ } else {
+ if (!fobj.isAutoLayout()) {
+ log.info("table-layout=\"fixed\" and width=\"auto\", "
+ + "but auto-layout not supported "
+ + "=> assuming width=\"100%\"");
+ }
+ contentIPD = referenceIPD - getIPIndents();
}
if (referenceIPD > context.getRefIPD()) {
log.warn("Allocated IPD exceeds available reference IPD");
}
- int contentIPD = referenceIPD - getIPIndents();
MinOptMax stackSize = new MinOptMax();
//Add spacing
@@ -291,7 +296,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager
LayoutContext lc = new LayoutContext(0);
- lc.setRefIPD(referenceIPD - getIPIndents());
+ lc.setRefIPD(contentIPD);
contentLM.setStartXOffset(startXOffset);
contentLM.addAreas(parentIter, lc);
tableHeight += contentLM.getUsedBPD();
@@ -342,7 +347,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager
TraitSetter.setProducerID(curBlockArea, getTable().getId());
- int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
setCurrentArea(curBlockArea);