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 +++++ 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'src/java/org/apache/fop/fo') 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(); -- cgit v1.2.3