You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2013/11/05 13:08:10 UTC

svn commit: r1538961 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/area/Footnote.java test/layoutengine/standard-testcases/footnote_jira1749.xml

Author: vhennebert
Date: Tue Nov  5 12:08:10 2013
New Revision: 1538961

URL: http://svn.apache.org/r1538961
Log:
FOP-1749: Fix offset of footnote when it has a margin-top
Patch by Alexey Neyman, applied with minor modifications

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Footnote.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Footnote.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Footnote.java?rev=1538961&r1=1538960&r2=1538961&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Footnote.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/area/Footnote.java Tue Nov  5 12:08:10 2013
@@ -83,7 +83,7 @@ public class Footnote extends BlockParen
     @Override
     public void addBlock(Block child) {
         addChildArea(child);
-        this.setBPD(this.getBPD() + child.getBPD());
+        setBPD(getBPD() + child.getAllocBPD());
     }
 
 }

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml?rev=1538961&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml Tue Nov  5 12:08:10 2013
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      FOP-1749: footnotes with margin-top="..." that do not fit on the current
+      page, but would've fit without top margin cause FOP to hang (instead of
+      being pushed to the next page). Also, verify the top-offset for the
+      footnote is calculated properly with margin-top.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master page-height="50pt" page-width="240pt" master-name="Body">
+          <fo:region-body/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="Body">
+        <fo:flow flow-name="xsl-region-body" font-size="10pt">
+          <fo:block>No footnote</fo:block>
+          <fo:block>Footnote call<fo:footnote>
+              <fo:inline>*</fo:inline>
+              <fo:footnote-body>
+                <fo:block margin-top="20pt">The footnote</fo:block>
+              </fo:footnote-body>
+            </fo:footnote>
+          </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- The block with footnote reference is on page 2 -->
+    <eval expected="Footnote call" xpath="//pageViewport[2]//mainReference//text"/>
+    <eval expected="The footnote" xpath="//pageViewport[2]//footnote//text"/>
+    <!-- And footnote's top-offset positions it on the page, not below -->
+    <eval expected="18000" xpath="//pageViewport[2]//footnote/@top-offset"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/footnote_jira1749.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id



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