aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2005-05-17 16:58:52 +0000
committerJeremias Maerki <jeremias@apache.org>2005-05-17 16:58:52 +0000
commit907fad82cc5494c0aba8679e0ea7523257540144 (patch)
treebc219f457cbd3756bb91eccacd95563e7ce5eb0b /src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
parent87b0189857ed596b10cca1eb1567bd7c2b27a009 (diff)
downloadxmlgraphics-fop-907fad82cc5494c0aba8679e0ea7523257540144.tar.gz
xmlgraphics-fop-907fad82cc5494c0aba8679e0ea7523257540144.zip
Bugfix: Area generated by page-number is now cloned for each addAreas() call.
Bugfix: page-number-citations are now properly resolved. The new method in AreaTreeHandler may not be optimal, but I haven't found a better way, yet. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198642 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
index f03973694..743db69af 100644
--- a/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
@@ -33,7 +33,7 @@ import org.apache.fop.fonts.Font;
public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager {
private PageNumberCitation fobj;
- Font font = null;
+ private Font font = null;
// whether the page referred to by the citation has been resolved yet
private boolean resolved = false;
@@ -62,8 +62,8 @@ public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager {
}
}
- protected void offsetArea(LayoutContext context) {
- curArea.setOffset(context.getBaseline());
+ protected void offsetArea(InlineArea area, LayoutContext context) {
+ area.setOffset(context.getBaseline());
}
/**
@@ -81,12 +81,7 @@ public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager {
int width = getStringWidth(str);
text.setTextArea(str);
inline.setIPD(width);
- inline.setBPD(font.getAscender() - font.getDescender());
- inline.setOffset(font.getAscender());
- inline.addTrait(Trait.FONT_NAME, font.getFontName());
- inline.addTrait(Trait.FONT_SIZE,
- new Integer(font.getFontSize()));
resolved = true;
} else {
resolved = false;
@@ -94,12 +89,12 @@ public class PageNumberCitationLayoutManager extends LeafNodeLayoutManager {
String str = "MMM"; // reserve three spaces for page number
int width = getStringWidth(str);
inline.setIPD(width);
- inline.setBPD(font.getAscender() - font.getDescender());
- inline.setOffset(font.getAscender());
- inline.addTrait(Trait.FONT_NAME, font.getFontName());
- inline.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
}
+ inline.setBPD(font.getAscender() - font.getDescender());
+ inline.setOffset(font.getAscender());
+ inline.addTrait(Trait.FONT_NAME, font.getFontName());
+ inline.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
TraitSetter.addTextDecoration(inline, fobj.getTextDecoration());
return inline;