From b23c22868235753eea72408debe2981d4e9e8b85 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 19 Oct 2005 13:08:17 +0000 Subject: [PATCH] Test case for space resolution in the footnote area. Currently disabled as the individual footnotes don't form a continuous element list where space resolution could be performed. Bugfix in PageSequenceLayoutManager: LMs are now informed about space resolution results and the spaces in the element lists don't cause an NPE anymore. AreaAdditionUtil: the layout manager parameter is now optional so it can be used for footnotes. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_SpaceResolution@326547 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/AreaAdditionUtil.java | 4 +- .../layoutmgr/PageSequenceLayoutManager.java | 7 ++- test/layoutengine/disabled-testcases.txt | 1 + .../testcases/footnote_space-resolution.xml | 58 +++++++++++++++++++ 4 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 test/layoutengine/testcases/footnote_space-resolution.xml diff --git a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java index 653fcab6f..a210754af 100644 --- a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java +++ b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java @@ -86,7 +86,7 @@ public class AreaAdditionUtil { } } - if (bslm.markers != null) { + if (bslm != null && bslm.markers != null) { bslm.getCurrentPV().addMarkers(bslm.markers, true, bslm.isFirst(firstPos), bslm.isLast(lastPos)); } @@ -107,7 +107,7 @@ public class AreaAdditionUtil { lc.setStackLimit(layoutContext.getStackLimit()); childLM.addAreas(childPosIter, lc); } - if (bslm.markers != null) { + if (bslm != null && bslm.markers != null) { bslm.getCurrentPV().addMarkers(bslm.markers, false, bslm.isFirst(firstPos), bslm.isLast(lastPos)); } diff --git a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java index e56b22b3e..6dbc997b3 100644 --- a/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java @@ -402,10 +402,11 @@ public class PageSequenceLayoutManager extends AbstractLayoutManager { int lastIndex = (i == pbp.footnoteLastListIndex ? pbp.footnoteLastElementIndex : elementList.size() - 1); - FootnoteBodyLayoutManager fblm = (FootnoteBodyLayoutManager) - ((KnuthElement) elementList.getFirst()).getLayoutManager(); + SpaceResolver.performConditionalsNotification(elementList, + firstIndex, lastIndex, -1); LayoutContext childLC = new LayoutContext(0); - fblm.addAreas(new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1), + AreaAdditionUtil.addAreas(null, + new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1), childLC); } // set the offset from the top margin diff --git a/test/layoutengine/disabled-testcases.txt b/test/layoutengine/disabled-testcases.txt index 665a568c8..fe51d05c4 100644 --- a/test/layoutengine/disabled-testcases.txt +++ b/test/layoutengine/disabled-testcases.txt @@ -6,6 +6,7 @@ block_space-before_space-after_8.xml block_word-spacing.xml block_word-spacing_text-align_justify.xml external-graphic_oversized.xml +footnote_space-resolution.xml inline-block_keep-together.xml inline_block_nested_3.xml inline_border_padding_block_nested_2.xml diff --git a/test/layoutengine/testcases/footnote_space-resolution.xml b/test/layoutengine/testcases/footnote_space-resolution.xml new file mode 100644 index 000000000..151e276b9 --- /dev/null +++ b/test/layoutengine/testcases/footnote_space-resolution.xml @@ -0,0 +1,58 @@ + + + + + +

+ This test checks space-resolution inside the footnotes area. +

+
+ + + + + + + + + + region-body + 1 + + + 1I'm a footnote! + + + blah + 2 + + + 2I'm a footnote! + + + + + + + + + + + + + +
-- 2.39.5