diff options
author | Simon Steiner <ssteiner@apache.org> | 2018-10-11 15:28:23 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2018-10-11 15:28:23 +0000 |
commit | 7951774f1754564fb27f775ce3eccbdf71e3e062 (patch) | |
tree | 6a8229e9ad3999cc49d65246f919196b79cafa77 /fop-core | |
parent | 73f73dd5b1f4a9693d44d9b975dff293f92823ce (diff) | |
download | xmlgraphics-fop-7951774f1754564fb27f775ce3eccbdf71e3e062.tar.gz xmlgraphics-fop-7951774f1754564fb27f775ce3eccbdf71e3e062.zip |
FOP-2822: Use correct ipd for table inside float
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1843563 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java index dd65be248..b489760ce 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java @@ -31,6 +31,7 @@ import org.apache.fop.fo.flow.Float; import org.apache.fop.fo.properties.CommonBorderPaddingBackground; import org.apache.fop.layoutmgr.inline.FloatLayoutManager; import org.apache.fop.layoutmgr.inline.KnuthInlineBox; +import org.apache.fop.layoutmgr.table.TableLayoutManager; public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutManager { @@ -75,7 +76,7 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa public void addChildArea(Area childArea) { floatContentArea.addChildArea(childArea); floatContentArea.setBPD(childArea.getAllocBPD()); - int effectiveContentIPD = childArea.getEffectiveAllocIPD(); + int effectiveContentIPD = getContentAreaIPD(childLMs, childArea); int contentIPD = childArea.getIPD(); int xOffset = childArea.getBorderAndPaddingWidthStart(); floatContentArea.setIPD(effectiveContentIPD); @@ -99,6 +100,26 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa } } + private int getContentAreaIPD(List<LayoutManager> childLMs, Area childArea) { + int ipd = getContentAreaIPD(childLMs); + if (ipd == 0) { + return childArea.getEffectiveAllocIPD(); + } + return ipd; + } + + private int getContentAreaIPD(List<LayoutManager> childLMs) { + int ipd = 0; + for (LayoutManager childLM : childLMs) { + if (childLM instanceof TableLayoutManager) { + ipd += childLM.getContentAreaIPD(); + } else { + ipd += getContentAreaIPD(childLM.getChildLMs()); + } + } + return ipd; + } + /** * {Add info} * |