xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vhenneb...@apache.org
Subject svn commit: r675590 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/area/AreaTreeParser.java src/java/org/apache/fop/render/xml/XMLRenderer.java test/layoutengine/standard-testcases/footnote_basic.xml
Date Thu, 10 Jul 2008 14:31:53 GMT
Author: vhennebert
Date: Thu Jul 10 07:31:52 2008
New Revision: 675590

URL: http://svn.apache.org/viewvc?rev=675590&view=rev
Log:
Bugzilla #45369: footnotes were rendered at the top of the region-body when using the intermediate
format

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_basic.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java?rev=675590&r1=675589&r2=675590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/AreaTreeParser.java Thu Jul 10 07:31:52
2008
@@ -21,12 +21,11 @@
 
 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.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.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 void startElement(Attributes attributes) {
                 Footnote fn = getCurrentBodyRegion().getFootnote();
                 transferForeignObjects(attributes, fn);
+                fn.setTop(getAttributeAsInteger(attributes, "top-offset", 0));
                 areaStack.push(fn);
             }
             

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=675590&r1=675589&r2=675590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java Thu Jul 10 07:31:52
2008
@@ -544,7 +544,9 @@
      * {@inheritDoc}
      */
     protected void renderFootnote(Footnote footnote) {
-        startElement("footnote");
+        atts.clear();
+        addAttribute("top-offset", footnote.getTop());
+        startElement("footnote", atts);
         super.renderFootnote(footnote);
         endElement("footnote");
     }

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_basic.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_basic.xml?rev=675590&r1=675589&r2=675590&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_basic.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_basic.xml Thu Jul
10 07:31:52 2008
@@ -68,6 +68,7 @@
     <eval expected="6000" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/inlineparent/text/@font-size"/>
     <eval expected=" in it." xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[1]/lineArea/text[2]"/>
     <!-- the footnote -->
+    <eval expected="201600" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/@top-offset"/>
     <eval expected="360000" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@ipd"/>
     <eval expected="14400" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/@bpd"/>
     <eval expected="11100" xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote/block[1]/lineArea/@bpd"/>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message