From 61552a1f108a32b369a9275a368225b8abee2730 Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Tue, 21 Feb 2023 08:49:47 +0000 Subject: [PATCH] FOP-3118: Text missing after page break inside table inline git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1907782 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AreaAdditionUtil.java | 13 +++-- .../table-inline-pagebreak.xml | 57 +++++++++++++++++++ 2 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java index e341078de..5d01c6f75 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java @@ -67,13 +67,13 @@ public final class AreaAdditionUtil { } if (pos instanceof NonLeafPosition && pos.getPosition() != null) { // pos was created by a child of this FlowLM - positionList.add(pos.getPosition()); - lastLM = (pos.getPosition().getLM()); + add(pos.getPosition(), positionList); + lastLM = pos.getPosition().getLM(); if (firstLM == null) { firstLM = lastLM; } } else if (pos instanceof SpaceHandlingBreakPosition) { - positionList.add(pos); + add(pos, positionList); } else { // pos was created by this LM, so it must be ignored } @@ -119,8 +119,11 @@ public final class AreaAdditionUtil { parentLM.isFirst(firstPos), parentLM.isLast(lastPos)); } - - } + private static void add(Position pos, LinkedList positionList) { + if (!positionList.isEmpty() || pos.getLM() != null) { + positionList.add(pos); + } + } } diff --git a/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml b/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml new file mode 100644 index 000000000..3b8cc52f0 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml @@ -0,0 +1,57 @@ + + + + + +

+ This test checks table inline page break +

+
+ + + + + + + + + + + + + + + + + + This is an example of a Table + + + + + + + + + + + + + + +
-- 2.39.5