瀏覽代碼

Implemented footnote separator.


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@196034 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-0_20_5rc3
Joerg Pietschmann 21 年之前
父節點
當前提交
a1118a6b72

+ 20
- 0
src/org/apache/fop/fo/flow/Footnote.java 查看文件

@@ -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

+ 8
- 1
src/org/apache/fop/fo/pagination/PageSequence.java 查看文件

@@ -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;
}

+ 6
- 12
src/org/apache/fop/layout/BodyAreaContainer.java 查看文件

@@ -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);

Loading…
取消
儲存