summaryrefslogtreecommitdiffstats
path: root/fop-core
diff options
context:
space:
mode:
Diffstat (limited to 'fop-core')
-rw-r--r--fop-core/src/main/java/org/apache/fop/layoutmgr/FloatContentLayoutManager.java23
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}
*