From 83266f47d0e1cd75ec69b841d462f572c0842b59 Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Wed, 13 May 2009 10:28:22 +0000 Subject: 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 --- src/java/org/apache/fop/fo/FONode.java | 31 ++++---- .../org/apache/fop/fo/flow/table/TablePart.java | 7 ++ status.xml | 3 + .../table_in_marker_bug47101.xml | 82 ++++++++++++++++++++++ 4 files changed, 105 insertions(+), 18 deletions(-) create mode 100644 test/layoutengine/standard-testcases/table_in_marker_bug47101.xml 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 @@ -69,6 +69,13 @@ public abstract class TablePart extends TableCellContainer { super(parent); } + /** {@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(); 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. --> + + Bugfix: The cells of a table inside a marker were duplicated at every marker retrieval. + 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 @@ + + + + + +

+ This test checks Bugzilla #47101 where the cells of a table defined inside a marker were + duplicated at every marker retrieval. +

+
+ + + + + + + + + + + + + + + + + + Table in a marker + + + + + + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + text + + + + + + + + + +
-- cgit v1.2.3