diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2009-05-13 10:28:22 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2009-05-13 10:28:22 +0000 |
commit | 83266f47d0e1cd75ec69b841d462f572c0842b59 (patch) | |
tree | 0e478735545ce1bffdd7d7b32a74a6638b6ccd16 | |
parent | 03ed498076aaabc791e5c89aea84f4d3c5efc9aa (diff) | |
download | xmlgraphics-fop-83266f47d0e1cd75ec69b841d462f572c0842b59.tar.gz xmlgraphics-fop-83266f47d0e1cd75ec69b841d462f572c0842b59.zip |
Bugzilla #47101: The cells of a table inside a marker were duplicated at every marker retrieval.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@774280 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/fo/FONode.java | 31 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/flow/table/TablePart.java | 7 | ||||
-rw-r--r-- | status.xml | 3 | ||||
-rw-r--r-- | test/layoutengine/standard-testcases/table_in_marker_bug47101.xml | 82 |
4 files changed, 105 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/fo/FONode.java b/src/java/org/apache/fop/fo/FONode.java index 07d8f472c..debb6a4b1 100644 --- a/src/java/org/apache/fop/fo/FONode.java +++ b/src/java/org/apache/fop/fo/FONode.java @@ -23,13 +23,12 @@ package org.apache.fop.fo; 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 abstract class FONode implements Cloneable { */ 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 + } } /** diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java index b1db59d91..3a3b75ff8 100644 --- a/src/java/org/apache/fop/fo/flow/table/TablePart.java +++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java @@ -70,6 +70,13 @@ public abstract class TablePart extends TableCellContainer { } /** {@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); diff --git a/status.xml b/status.xml index 27f7bc2c1..3f28ccbab 100644 --- a/status.xml +++ b/status.xml @@ -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. diff --git a/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml b/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml new file mode 100644 index 000000000..48d9bbc69 --- /dev/null +++ b/test/layoutengine/standard-testcases/table_in_marker_bug47101.xml @@ -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> |