From: Simon Steiner Date: Tue, 30 Jul 2024 10:25:57 +0000 (+0100) Subject: FOP-3195: Skip written block ipds inside float X-Git-Tag: 2_10~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f9e031ace069602f5a67222b32e2f1ce3fdc54fc;p=xmlgraphics-fop.git FOP-3195: Skip written block ipds inside float --- diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java index a3edc2088..dba4723c9 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBaseLayoutManager.java @@ -209,14 +209,8 @@ public abstract class AbstractBaseLayoutManager "getContentAreaIPD() called when it should have been overridden"); } - /** - * {@inheritDoc} - * NOTE: Should be overridden by subclasses. - * Default implementation throws an UnsupportedOperationException. - */ public int getContentAreaBPD() { - throw new UnsupportedOperationException( - "getContentAreaBPD() called when it should have been overridden"); + return 0; } /** {@inheritDoc} */ 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 b489760ce..8a82f2398 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 @@ -113,7 +113,7 @@ public class FloatContentLayoutManager extends SpacedBorderedPaddedBlockLayoutMa for (LayoutManager childLM : childLMs) { if (childLM instanceof TableLayoutManager) { ipd += childLM.getContentAreaIPD(); - } else { + } else if (childLM.getContentAreaBPD() != -1) { ipd += getContentAreaIPD(childLM.getChildLMs()); } } diff --git a/fop/test/layoutengine/standard-testcases/float_10.xml b/fop/test/layoutengine/standard-testcases/float_10.xml new file mode 100644 index 000000000..5969c6626 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/float_10.xml @@ -0,0 +1,57 @@ + + + +

+ Test position of float containing tables +

+
+ + + + + + + + + + + + + + + + + + + + Visit My Account + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file