xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r588733 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/render/ps/PSRenderer.java test/layoutengine/standard-testcases/ps-extension_2.xml
Date Fri, 26 Oct 2007 18:17:01 GMT
Author: acumiskey
Date: Fri Oct 26 11:17:00 2007
New Revision: 588733

URL: http://svn.apache.org/viewvc?rev=588733&view=rev
Log:
Applying [PATCH] 43587 - Multiple ps:comment-? within fo:declarations causes ClassCastException

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java
    xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/ps-extension_2.xml

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java?rev=588733&r1=588732&r2=588733&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java Fri Oct 26 11:17:00
2007
@@ -830,6 +830,7 @@
                 PSExtensionAttachment comment = (PSExtensionAttachment)iter.next();
                 gen.commentln("%" + comment.getContent());
             }
+            footerComments.clear();
         }
         gen.writeDSCComment(DSCConstants.PAGES, new Integer(this.currentPageNumber));
         gen.getResourceTracker().writeResources(false, gen);
@@ -840,7 +841,12 @@
             IOUtils.closeQuietly(gen.getOutputStream());
             rewritePostScriptFile();
         }
-        this.pageDeviceDictionary.clear();
+        if (footerComments != null) {
+            headerComments.clear();
+        }
+        if (pageDeviceDictionary != null) {
+            pageDeviceDictionary.clear();
+        }
     }
     
     /**
@@ -910,12 +916,12 @@
                         }
                     } else if (attachment instanceof PSCommentBefore) {
                         if (headerComments == null) {
-                            headerComments = new java.util.TreeSet();
+                            headerComments = new java.util.ArrayList();
                         }
                         headerComments.add(attachment);
                     } else if (attachment instanceof PSCommentAfter) {
                         if (footerComments == null) {
-                            footerComments = new java.util.TreeSet();
+                            footerComments = new java.util.ArrayList();
                         }
                         footerComments.add(attachment);
                     }

Modified: xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/ps-extension_2.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/ps-extension_2.xml?rev=588733&r1=588732&r2=588733&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/ps-extension_2.xml (original)
+++ xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/ps-extension_2.xml Fri Oct
26 11:17:00 2007
@@ -34,8 +34,10 @@
         </fo:simple-page-master>
         <fo:simple-page-master master-name="A4a" page-height="29.7cm" page-width="21cm"
margin-top="1cm" margin-bottom="2cm" margin-left="2.5cm" margin-right="2.5cm">
           <ps:ps-setpagedevice name="upper tray"><![CDATA[ << /MediaPosition
1 >> ]]></ps:ps-setpagedevice>
-          <ps:ps-comment-before>A4a before page</ps:ps-comment-before>
-          <ps:ps-comment-after>A4a after page</ps:ps-comment-after>
+          <ps:ps-comment-before>A4a before page 1</ps:ps-comment-before>
+          <ps:ps-comment-after>A4a after page 1</ps:ps-comment-after>
+          <ps:ps-comment-before>A4a before page 2</ps:ps-comment-before>
+          <ps:ps-comment-after>A4a after page 2</ps:ps-comment-after>
           <fo:region-body background-color="orange"/>
         </fo:simple-page-master>
         <fo:page-sequence-master master-name="complex">
@@ -46,8 +48,10 @@
       </fo:layout-master-set>
       <fo:declarations>
         <ps:ps-setpagedevice name="autofeed"><![CDATA[ << /ManualFeed false
>> ]]></ps:ps-setpagedevice>
-        <ps:ps-comment-before>header comment</ps:ps-comment-before>
-        <ps:ps-comment-after>footer comment</ps:ps-comment-after>
+        <ps:ps-comment-before>header comment 1</ps:ps-comment-before>
+        <ps:ps-comment-after>footer comment 1</ps:ps-comment-after>
+        <ps:ps-comment-before>header comment 2</ps:ps-comment-before>
+        <ps:ps-comment-after>footer comment 2</ps:ps-comment-after>
       </fo:declarations>
       <fo:page-sequence master-reference="complex">
         <fo:flow flow-name="xsl-region-body">
@@ -64,20 +68,24 @@
     <eval expected="2" xpath="count(/areaTree/child::*)"/>
     <eval expected="1" xpath="count(/areaTree/child::pageSequence)"/>
     <eval expected="1" xpath="count(/areaTree/child::extension-attachments)"/>
-    <eval expected="3" xpath="count(/areaTree/child::extension-attachments/child::*)"/>
+    <eval expected="5" xpath="count(/areaTree/child::extension-attachments/child::*)"/>
     <eval expected="autofeed"       xpath="/areaTree/extension-attachments/child::*[1]/@name"/>
-    <eval expected="header comment" xpath="/areaTree/extension-attachments/child::*[2]/text()"/>
-    <eval expected="footer comment" xpath="/areaTree/extension-attachments/child::*[3]/text()"/>
+    <eval expected="header comment 1" xpath="/areaTree/extension-attachments/child::*[2]/text()"/>
+    <eval expected="footer comment 1" xpath="/areaTree/extension-attachments/child::*[3]/text()"/>
+    <eval expected="header comment 2" xpath="/areaTree/extension-attachments/child::*[4]/text()"/>
+    <eval expected="footer comment 2" xpath="/areaTree/extension-attachments/child::*[5]/text()"/>
 
     <eval expected="3" xpath="count(/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=1]/page/extension-attachments/child::*)"/>
     <eval expected="lower tray" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=1]/page/extension-attachments/child::*[1]/@name"/>
     <eval expected="A4 before page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=1]/page/extension-attachments/child::*[2]"/>
     <eval expected="A4 after page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=1]/page/extension-attachments/child::*[3]"/>
 
-    <eval expected="3" xpath="count(/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*)"/>
+    <eval expected="5" xpath="count(/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*)"/>
     <eval expected="upper tray" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[1]/@name"/>
-    <eval expected="A4a before page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[2]"/>
-    <eval expected="A4a after page" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[3]"/>
+    <eval expected="A4a before page 1" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[2]"/>
+    <eval expected="A4a after page 1" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[3]"/>
+    <eval expected="A4a before page 2" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[4]"/>
+    <eval expected="A4a after page 2" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4a'
and @nr=2]/page/extension-attachments/child::*[5]"/>
 
     <eval expected="3" xpath="count(/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=3]/page/extension-attachments/child::*)"/>
     <eval expected="lower tray" xpath="/areaTree/pageSequence/pageViewport[@simple-page-master-name='A4'
and @nr=3]/page/extension-attachments/child::*[1]/@name"/>



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


Mime
View raw message