Parcourir la source

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
tags/fop-1_0
Vincent Hennebert il y a 15 ans
Parent
révision
83266f47d0

+ 13
- 18
src/java/org/apache/fop/fo/FONode.java Voir le fichier

@@ -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
}
}

/**

+ 7
- 0
src/java/org/apache/fop/fo/flow/table/TablePart.java Voir le fichier

@@ -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();

+ 3
- 0
status.xml Voir le fichier

@@ -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.

+ 82
- 0
test/layoutengine/standard-testcases/table_in_marker_bug47101.xml Voir le fichier

@@ -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>

Chargement…
Annuler
Enregistrer