diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-07-10 14:31:52 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-07-10 14:31:52 +0000 |
commit | a8534f0b6d0194272e0eb571a956748caeb1089a (patch) | |
tree | bf7d82e8a899159f51adcf9045328e232612e04b /src | |
parent | cfa07fa31d84d76ee264bd187bd1ed46c8d05129 (diff) | |
download | xmlgraphics-fop-a8534f0b6d0194272e0eb571a956748caeb1089a.tar.gz xmlgraphics-fop-a8534f0b6d0194272e0eb571a956748caeb1089a.zip |
Bugzilla #45369: footnotes were rendered at the top of the region-body when using the intermediate format
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@675590 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/area/AreaTreeParser.java | 28 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/xml/XMLRenderer.java | 4 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java index 6d9fd4f32..e4de505b0 100644 --- a/src/java/org/apache/fop/area/AreaTreeParser.java +++ b/src/java/org/apache/fop/area/AreaTreeParser.java @@ -21,12 +21,11 @@ package org.apache.fop.area; import java.awt.Color; import java.awt.geom.Rectangle2D; +import java.nio.CharBuffer; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Stack; -import java.util.StringTokenizer; -import java.nio.CharBuffer; import javax.xml.transform.Source; import javax.xml.transform.Transformer; @@ -37,22 +36,8 @@ import javax.xml.transform.sax.SAXResult; import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; -import org.w3c.dom.DOMImplementation; -import org.w3c.dom.Document; - -import org.xml.sax.Attributes; -import org.xml.sax.ContentHandler; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; - -import org.apache.xmlgraphics.image.loader.ImageInfo; -import org.apache.xmlgraphics.image.loader.ImageManager; -import org.apache.xmlgraphics.image.loader.ImageSessionContext; -import org.apache.xmlgraphics.util.QName; - import org.apache.fop.apps.FOUserAgent; import org.apache.fop.area.Trait.Background; import org.apache.fop.area.Trait.InternalLink; @@ -80,6 +65,16 @@ import org.apache.fop.util.ContentHandlerFactory; import org.apache.fop.util.ContentHandlerFactoryRegistry; import org.apache.fop.util.ConversionUtils; import org.apache.fop.util.DefaultErrorListener; +import org.apache.xmlgraphics.image.loader.ImageInfo; +import org.apache.xmlgraphics.image.loader.ImageManager; +import org.apache.xmlgraphics.image.loader.ImageSessionContext; +import org.apache.xmlgraphics.util.QName; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; /** * This is a parser for the area tree XML (intermediate format) which is used to reread an area @@ -559,6 +554,7 @@ public class AreaTreeParser { public void startElement(Attributes attributes) { Footnote fn = getCurrentBodyRegion().getFootnote(); transferForeignObjects(attributes, fn); + fn.setTop(getAttributeAsInteger(attributes, "top-offset", 0)); areaStack.push(fn); } diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java index b41de7387..aec067b91 100644 --- a/src/java/org/apache/fop/render/xml/XMLRenderer.java +++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java @@ -544,7 +544,9 @@ public class XMLRenderer extends AbstractXMLRenderer { * {@inheritDoc} */ protected void renderFootnote(Footnote footnote) { - startElement("footnote"); + atts.clear(); + addAttribute("top-offset", footnote.getTop()); + startElement("footnote", atts); super.renderFootnote(footnote); endElement("footnote"); } |