git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196034 13f79535-47bb-0310-9956-ffa450edef68tags/fop-0_20_5rc3
@@ -129,6 +129,26 @@ public class Footnote extends FObj { | |||
footArea.setMaxHeight(bac.getMaxHeight() | |||
+ footArea.getHeight()); | |||
} | |||
if (!footArea.hasChildren()) { | |||
StaticContent separator = bac.getPage().getPageSequence() | |||
.getStaticContent("xsl-footnote-separator"); | |||
if (separator!=null) { | |||
footArea.setIDReferences(bac.getIDReferences()); | |||
separator.layout(footArea, null); | |||
int diff = footArea.getHeight() - oldHeight; | |||
if (area != null) { | |||
area.setMaxHeight(area.getMaxHeight() - diff); | |||
} | |||
if (bac.getFootnoteState() == 0) { | |||
Area ar = bac.getMainReferenceArea(); | |||
decreaseMaxHeight(ar, diff); | |||
footArea.setYPosition(basePos + footArea.getHeight()); | |||
} | |||
basePos = footArea.getCurrentYPosition() | |||
- footArea.getHeight(); | |||
oldHeight = footArea.getHeight(); | |||
} | |||
} | |||
int status = fb.layout(footArea); | |||
if (Status.isIncomplete(status)) { | |||
// add as a pending footnote |
@@ -234,7 +234,10 @@ public class PageSequence extends FObj { | |||
if (flowMap.containsKey(staticContent.getFlowName())) { | |||
throw new FOPException("flow-names must be unique within an fo:page-sequence"); | |||
} | |||
if (!this.layoutMasterSet.regionNameExists(staticContent.getFlowName())) { | |||
String flowName = staticContent.getFlowName(); | |||
if (!this.layoutMasterSet.regionNameExists(flowName) | |||
&& !flowName.equals("xsl-before-float-separator") | |||
&& !flowName.equals("xsl-footnote-separator")) { | |||
log.error("region-name '" | |||
+ staticContent.getFlowName() | |||
+ "' doesn't exist in the layout-master-set."); | |||
@@ -480,6 +483,10 @@ public class PageSequence extends FObj { | |||
// + flow.getFlowName() + "'"); | |||
} | |||
public StaticContent getStaticContent(String regionName) { | |||
return (StaticContent)flowMap.get(regionName); | |||
} | |||
public int getCurrentPageNumber() { | |||
return currentPageNumber; | |||
} |
@@ -82,8 +82,6 @@ public class BodyAreaContainer extends Area { | |||
// current heights | |||
private int mainRefAreaHeight; | |||
private int beforeFloatRefAreaHeight; | |||
private int footnoteRefAreaHeight; | |||
// reference area yPositions | |||
private int mainYPosition; | |||
@@ -109,13 +107,11 @@ public class BodyAreaContainer extends Area { | |||
this.columnGap = columnGap; | |||
// create the primary reference areas | |||
beforeFloatRefAreaHeight = 0; | |||
footnoteRefAreaHeight = 0; | |||
mainRefAreaHeight = maxHeight - beforeFloatRefAreaHeight | |||
- footnoteRefAreaHeight; | |||
mainRefAreaHeight = maxHeight; | |||
beforeFloatReferenceArea = new AreaContainer(fontState, xPosition, | |||
yPosition, allocationWidth, beforeFloatRefAreaHeight, | |||
Position.ABSOLUTE); | |||
yPosition, | |||
allocationWidth, 0, | |||
Position.ABSOLUTE); | |||
beforeFloatReferenceArea.setAreaName("before-float-reference-area"); | |||
this.addChild(beforeFloatReferenceArea); | |||
mainReferenceArea = new AreaContainer(fontState, xPosition, | |||
@@ -124,11 +120,9 @@ public class BodyAreaContainer extends Area { | |||
Position.ABSOLUTE); | |||
mainReferenceArea.setAreaName("main-reference-area"); | |||
this.addChild(mainReferenceArea); | |||
int footnoteRefAreaYPosition = yPosition - mainRefAreaHeight; | |||
footnoteReferenceArea = new AreaContainer(fontState, xPosition, | |||
footnoteRefAreaYPosition, | |||
allocationWidth, | |||
footnoteRefAreaHeight, | |||
yPosition - mainRefAreaHeight, | |||
allocationWidth, 0, | |||
Position.ABSOLUTE); | |||
footnoteReferenceArea.setAreaName("footnote-reference-area"); | |||
this.addChild(footnoteReferenceArea); |