diff options
author | Simon Steiner <ssteiner@apache.org> | 2021-09-01 06:11:31 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2021-09-01 06:11:31 +0000 |
commit | fc24ca179b914ba84486f18c337e344b0abb43a1 (patch) | |
tree | b50756dc3194f378c9042f03659fee8eb9ec0b98 /fop-core/src | |
parent | b23edd0f37ef50c18f0a91d544417ef7e7b3561f (diff) | |
download | xmlgraphics-fop-fc24ca179b914ba84486f18c337e344b0abb43a1.tar.gz xmlgraphics-fop-fc24ca179b914ba84486f18c337e344b0abb43a1.zip |
FOP-3025: Keep table size on changing ipd which has graphics
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1892775 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core/src')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index b4b49b705..f3407b749 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -34,6 +34,7 @@ import org.apache.fop.datatypes.LengthBase; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.flow.AbstractGraphics; import org.apache.fop.fo.flow.Marker; import org.apache.fop.fo.flow.Markers; import org.apache.fop.fo.flow.RetrieveTableMarker; @@ -243,7 +244,9 @@ public class TableLayoutManager extends SpacedBorderedPaddedBlockLayoutManager */ if (tableUnit == 0.0) { tableUnit = columns.computeTableUnit(this); - tableUnit = Math.max(tableUnit, oldTableUnit); + if (oldTableUnit > tableUnit && supportResize(fobj)) { + tableUnit = oldTableUnit; + } } if (!firstVisibleMarkServed) { @@ -314,6 +317,20 @@ public class TableLayoutManager extends SpacedBorderedPaddedBlockLayoutManager return returnList; } + private boolean supportResize(FONode node) { + if (node instanceof AbstractGraphics) { + return false; + } + FONode.FONodeIterator iterator = node.getChildNodes(); + while (iterator != null && iterator.hasNext()) { + FONode x = (FONode) iterator.next(); + if (!supportResize(x)) { + return false; + } + } + return true; + } + /** {@inheritDoc} */ public Position getAuxiliaryPosition() { /* |