From: Jeremias Maerki Date: Mon, 15 May 2006 09:59:59 +0000 (+0000) Subject: Bugfix: tables nested in inline elements caused a NullPointerException. X-Git-Tag: fop-0_93~233 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c5f8b9642c009eb912a9543ae27a879c5e9a8b72;p=xmlgraphics-fop.git Bugfix: tables nested in inline elements caused a NullPointerException. Furthermore, keep-together handling was not appropriate when a table is nested in an inline (fixes a ClassCastException). Finally, TableContentPosition did not indicate that it generates area which made them be ignored by the InlineLM. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@406596 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 9c3e89780..3c6b7c6f2 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -1127,6 +1127,11 @@ public class TableContentLayoutManager implements PercentBaseContext { } } + /** @see org.apache.fop.layoutmgr.Position#generatesAreas() */ + public boolean generatesAreas() { + return true; + } + /** @see java.lang.Object#toString() */ public String toString() { StringBuffer sb = new StringBuffer("TableContentPosition:"); diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index a50cf1317..2810401ae 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -61,7 +61,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager private Block curBlockArea; - private int referenceBPD; private double tableUnits; private boolean autoLayout = true; @@ -156,7 +155,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager } } - referenceBPD = context.getStackLimit().opt; referenceIPD = context.getRefIPD(); if (getTable().getInlineProgressionDimension().getOptimum(this).getEnum() != EN_AUTO) { @@ -449,7 +447,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager */ public boolean mustKeepTogether() { //TODO Keeps will have to be more sophisticated sooner or later - return ((BlockLevelLayoutManager)getParent()).mustKeepTogether() + return super.mustKeepTogether() || !getTable().getKeepTogether().getWithinPage().isAuto() || !getTable().getKeepTogether().getWithinColumn().isAuto(); } @@ -495,14 +493,6 @@ public class TableLayoutManager extends BlockStackingLayoutManager } } - /** - * Returns the BPD of the content area - * @return the BPD of the content area - */ - public int getContentAreaBPD() { - return referenceBPD; - } - /** @see org.apache.fop.layoutmgr.ConditionalElementListener */ public void notifySpace(RelSide side, MinOptMax effectiveLength) { if (RelSide.BEFORE == side) { diff --git a/status.xml b/status.xml index c2f835f65..6eeebfe14 100644 --- a/status.xml +++ b/status.xml @@ -27,6 +27,9 @@ + + Bugfix: tables nested in inline elements caused a NullPointerException. + The default sRGB color profile provided by the Java class library is no longer embedded if it is encountered. This should reduce the PDF size considerably. diff --git a/test/layoutengine/standard-testcases/inline_table_nested_1.xml b/test/layoutengine/standard-testcases/inline_table_nested_1.xml new file mode 100644 index 000000000..9b483aabc --- /dev/null +++ b/test/layoutengine/standard-testcases/inline_table_nested_1.xml @@ -0,0 +1,55 @@ + + + + + +

+ This test checks fo:inline and nested fo:tables. +

+
+ + + + + + + + + + + part1 + + + + + + + table content + + + + part2 + + + + + + + + + +