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 2009/05/13 12:28:22 UTC

svn commit: r774280 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/FONode.java src/java/org/apache/fop/fo/flow/table/TablePart.java status.xml test/layoutengine/standard-testcases/table_in_marker_bug47101.xml

Author: vhennebert
Date: Wed May 13 10:28:22 2009
New Revision: 774280

URL: http://svn.apache.org/viewvc?rev=774280&view=rev
Log:
Bugzilla #47101: The cells of a table inside a marker were duplicated at every marker retrieval.

Added:
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
    xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TablePart.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java?rev=774280&r1=774279&r2=774280&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/FONode.java Wed May 13 10:28:22 2009
@@ -23,13 +23,12 @@
 import java.util.ListIterator;
 import java.util.Map;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.Locator;
 import org.xml.sax.helpers.LocatorImpl;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import org.apache.xmlgraphics.util.QName;
 
 import org.apache.fop.apps.FOPException;
@@ -90,23 +89,19 @@
      */
     public FONode clone(FONode cloneparent, boolean removeChildren)
                 throws FOPException {
-        try {
-            FONode foNode = (FONode) clone();
-            foNode.parent = cloneparent;
-            foNode.siblings = null;
-            return foNode;
-        } catch (CloneNotSupportedException cnse) {
-            return null;
-        }
+        FONode foNode = (FONode) clone();
+        foNode.parent = cloneparent;
+        foNode.siblings = null;
+        return foNode;
     }
 
-    /**
-     * Perform a shallow cloning operation
-     *
-     * {@inheritDoc}
-     */
-    protected Object clone() throws CloneNotSupportedException {
-        return super.clone();
+    /** {@inheritDoc} */
+    protected Object clone() {
+        try {
+            return super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new AssertionError(); // Can't happen
+        }
     }
 
     /**

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TablePart.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TablePart.java?rev=774280&r1=774279&r2=774280&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TablePart.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/table/TablePart.java Wed May 13 10:28:22 2009
@@ -70,6 +70,13 @@
     }
 
     /** {@inheritDoc} */
+    protected Object clone() {
+        TablePart clone = (TablePart) super.clone();
+        clone.rowGroups = new LinkedList(rowGroups);
+        return clone;
+    }
+
+    /** {@inheritDoc} */
     public void bind(PropertyList pList) throws FOPException {
         commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
         super.bind(pList);

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=774280&r1=774279&r2=774280&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Wed May 13 10:28:22 2009
@@ -58,6 +58,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="VH" type="fix" fixes-bug="47101">
+        Bugfix: The cells of a table inside a marker were duplicated at every marker retrieval.
+      </action>
       <action context="Images" dev="JM" type="fix">
         Bugfix: use the effective color profile supplied by the ImageEncodingHelper, instead of the 
         original one.

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml?rev=774280&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml Wed May 13 10:28:22 2009
@@ -0,0 +1,82 @@
+<?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>
+      This test checks Bugzilla #47101 where the cells of a table defined inside a marker were 
+      duplicated at every marker retrieval.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page" page-width="400pt" page-height="300pt" margin="20pt">
+          <fo:region-body margin-bottom="40pt"/>
+          <fo:region-after extent="40pt"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:static-content flow-name="xsl-region-after">
+          <fo:retrieve-marker retrieve-boundary="page" retrieve-position="first-including-carryover" 
+            retrieve-class-name="page-footer"/>
+        </fo:static-content>
+        <fo:flow flow-name="xsl-region-body">
+          <fo:marker marker-class-name="page-footer"
+            ><fo:table table-layout="fixed" width="100%">
+              <fo:table-body>
+                <fo:table-row>
+                  <fo:table-cell>
+                    <fo:block font-size="8pt" font-style="italic">Table in a marker</fo:block>
+                  </fo:table-cell>
+                </fo:table-row>
+              </fo:table-body>
+            </fo:table>
+          </fo:marker>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+          <fo:block space-after="12pt">text</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="1" xpath="count(//pageViewport[1]//regionAfter/block/block)"/>
+    <eval expected="1" xpath="count(//pageViewport[2]//regionAfter/block/block)"/>
+    <eval expected="1" xpath="count(//pageViewport[3]//regionAfter/block/block)"/>
+  </checks>
+</testcase>

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

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_in_marker_bug47101.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