From: Jeremias Maerki Date: Wed, 19 Oct 2005 13:04:44 +0000 (+0000) Subject: Space resolution bugfix: Space specifiers didn't collapse when there was not break... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f63d84f4e4ec41941b464ec07dc964b51cdb1f24;p=xmlgraphics-fop.git Space resolution bugfix: Space specifiers didn't collapse when there was not break in the sequence. Test case for space resolution in side regions. This test case showed me the above bug. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_SpaceResolution@326545 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java index 2304d5ac5..49e416119 100644 --- a/src/java/org/apache/fop/layoutmgr/SpaceResolver.java +++ b/src/java/org/apache/fop/layoutmgr/SpaceResolver.java @@ -359,8 +359,8 @@ public class SpaceResolver { } else { if (isFirst || isLast) { performSpaceResolutionRule1(secondPart, secondPartLengths); - performSpaceResolutionRules2to3(secondPart, secondPartLengths); } + performSpaceResolutionRules2to3(secondPart, secondPartLengths); } } diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index b77275fa0..34da18505 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -19,11 +19,13 @@ package org.apache.fop.layoutmgr; import java.util.LinkedList; +import java.util.List; import java.util.ListIterator; import org.apache.fop.area.RegionReference; import org.apache.fop.area.Area; import org.apache.fop.area.Block; +import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.SideRegion; import org.apache.fop.fo.pagination.StaticContent; import org.apache.fop.layoutmgr.inline.InlineLevelLayoutManager; @@ -251,6 +253,16 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { this.displayAlign = displayAlign; } + /** @see org.apache.fop.layoutmgr.AbstractBreaker#observeElementList(java.util.List) */ + protected void observeElementList(List elementList) { + String elementListID = getStaticContentFO().getFlowName(); + String pageSequenceID = ((PageSequence)lm.getParent().getFObj()).getId(); + if (pageSequenceID != null && pageSequenceID.length() > 0) { + elementListID += "-" + pageSequenceID; + } + ElementListObserver.observe(elementList, "static-content", elementListID); + } + /** @see org.apache.fop.layoutmgr.AbstractBreaker#isPartOverflowRecoveryActivated() */ protected boolean isPartOverflowRecoveryActivated() { //For side regions, this must be disabled because of wanted overflow. diff --git a/test/layoutengine/testcases/region_side_space-resolution.xml b/test/layoutengine/testcases/region_side_space-resolution.xml new file mode 100644 index 000000000..a7e8af0ec --- /dev/null +++ b/test/layoutengine/testcases/region_side_space-resolution.xml @@ -0,0 +1,64 @@ + + + + + +

+ This test checks if space resolution works in side regions. +

+
+ + + + + + + + + + + line 1 + line 2 + + + region-body + + + + + + + + + + + + + + + + + + 3 + + + + + + + +