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 ad...@apache.org on 2009/06/05 10:43:11 UTC

svn commit: r781944 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java status.xml test/layoutengine/standard-testcases/markers_empty_bug46960.xml

Author: adelmelle
Date: Fri Jun  5 08:43:10 2009
New Revision: 781944

URL: http://svn.apache.org/viewvc?rev=781944&view=rev
Log:
Bugzilla 46960: Previously retrieved marker not cleared when the subsequently retrieved marker was empty.

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

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java?rev=781944&r1=781943&r2=781944&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java Fri Jun  5 08:43:10 2009
@@ -155,11 +155,6 @@
 
     private void cloneFromMarker(Marker marker)
         throws FOPException {
-        // clean up remnants from a possible earlier layout
-        if (firstChild != null) {
-            currentTextNode = null;
-            firstChild = null;
-        }
         cloneSubtree(marker.getChildNodes(), this,
                         marker, propertyList);
         handleWhiteSpaceFor(this, null);
@@ -171,6 +166,11 @@
      * @param marker the marker that is to be cloned
      */
     public void bindMarker(Marker marker) {
+        // clean up remnants from a possible earlier layout
+        if (firstChild != null) {
+            currentTextNode = null;
+            firstChild = null;
+        }
         if (marker.getChildNodes() != null) {
             try {
                 cloneFromMarker(marker);

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=781944&r1=781943&r2=781944&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Fri Jun  5 08:43:10 2009
@@ -58,18 +58,21 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="AD" type="fix" fixes-bug="46960">
+        Bugfix: previously retrieved markers were not cleared if the new marker was empty.
+      </action>
       <action context="Fonts" dev="VH" type="fix" fixes-bug="47232" due-to="Maxim Wirt">
         Bugfix: for the last character of a Type1 font, always a width of 0 was returned.
       </action>
       <action context="Code" dev="VH" type="fix">
-        Changed meaning of ‘-v’ option to ‘verbose’, which will print FOP’s version and proceed. 
+        Changed meaning of ‘-v’ option to ‘verbose’, which will print FOP’s version and proceed.
         Added a ‘-version’ option to simply print the version then exit, following Java practices.
       </action>
       <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 
+        Bugfix: use the effective color profile supplied by the ImageEncodingHelper, instead of the
         original one.
       </action>
       <action context="Renderers" dev="JM" type="fix">
@@ -79,20 +82,20 @@
         Added setting to enable dithered painting of filled rectangles in AFP and PCL.
       </action>
       <action context="Layout" dev="VH" type="fix">
-        Bugfix: footnotes occurring within the forced height of a table row did not appear on the 
+        Bugfix: footnotes occurring within the forced height of a table row did not appear on the
         output
       </action>
       <action context="Renderers" dev="JM" type="update" fixes-bug="47031" due-to="Francois Fernandes">
         PDFGraphics2D.writeClip doesn't generate a clip command anymore when the clip path
-        is empty. 
+        is empty.
       </action>
       <action context="Renderers" dev="JM" type="add" fixes-bug="47000">
         Added a custom text painter for rendering SVG text using text operators when rendering
-        to PostScript or EPS. Text is no longer painted as shapes, thus creating much smaller files. 
+        to PostScript or EPS. Text is no longer painted as shapes, thus creating much smaller files.
       </action>
       <action context="Renderers" dev="JM" type="fix">
         Fixed a bug that left the PrintRenderer unconfigured even if a configuration was
-        specified for "application/X-fop-print". 
+        specified for "application/X-fop-print".
       </action>
       <action context="Renderers" dev="JM" type="fix" fixes-bug="46882" due-to="Yegor Kozlov">
         Fixed the handling of CMYK colors in PDFGraphics2D.

Added: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/markers_empty_bug46960.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/markers_empty_bug46960.xml?rev=781944&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/markers_empty_bug46960.xml (added)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/markers_empty_bug46960.xml Fri Jun  5 08:43:10 2009
@@ -0,0 +1,54 @@
+<?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 for bug 46960: retrieve-markers not cleared if a subsequent
+      retrieved marker is empty.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="a4" page-width="210mm" page-height="297mm" margin="5mm">
+          <fo:region-body margin-top="2cm"/>
+          <fo:region-before extent="2cm" region-name="header"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="a4">
+        <fo:static-content flow-name="header">
+          <fo:block><fo:retrieve-marker id="rm-cont-1" retrieve-class-name="Continued" retrieve-boundary="document" retrieve-position="first-starting-within-page"/></fo:block>
+        </fo:static-content>
+        <fo:flow flow-name="xsl-region-body">
+          <fo:block><fo:marker marker-class-name="Continued"/>First Page</fo:block>
+          <fo:block break-before="page"><fo:marker marker-class-name="Continued">Continued</fo:marker>Second Page</fo:block>
+          <fo:block break-before="page"><fo:marker marker-class-name="Continued"/>Third Page</fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <!-- first retrieved marker is empty -->
+    <eval expected="0" xpath="(//page)[1]//regionBefore/block/@bpd" />
+    <!-- second marker is "Continued" -->
+    <eval expected="Continued" xpath="(//page)[2]//regionBefore/block/lineArea/text/word" />
+    <!-- third marker should be empty again -->
+    <eval expected="0" xpath="(//page)[3]//regionBefore/block/@bpd" />
+  </checks>
+</testcase>

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

Propchange: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/markers_empty_bug46960.xml
------------------------------------------------------------------------------
    svn:keywords = Id



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org