xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerem...@apache.org
Subject svn commit: r588545 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java
Date Fri, 26 Oct 2007 07:32:56 GMT
Author: jeremias
Date: Fri Oct 26 00:32:50 2007
New Revision: 588545

URL: http://svn.apache.org/viewvc?rev=588545&view=rev
Log:
Fix for ClassCastException if non-PS extension attachments are encountered.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/ps/PSRenderer.java

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=588545&r1=588544&r2=588545&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 00:32:50
2007
@@ -1055,10 +1055,12 @@
         if (page.hasExtensionAttachments()) {
             List extensionAttachments = page.getExtensionAttachments();
             for (int i = 0; i < extensionAttachments.size(); i++) {
-                PSExtensionAttachment attachment
-                    = (PSExtensionAttachment)extensionAttachments.get(i);
-                if (attachment instanceof PSCommentBefore) {
-                    gen.commentln("%" + attachment.getContent());
+                Object attObj = extensionAttachments.get(i);
+                if (attObj instanceof PSExtensionAttachment) {
+                    PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
+                    if (attachment instanceof PSCommentBefore) {
+                        gen.commentln("%" + attachment.getContent());
+                    }
                 }
             }
         }
@@ -1091,10 +1093,12 @@
         if (page.hasExtensionAttachments()) {
             List extensionAttachments = page.getExtensionAttachments();
             for (int i = 0; i < extensionAttachments.size(); i++) {
-                PSExtensionAttachment attachment;
-                attachment = (PSExtensionAttachment)extensionAttachments.get(i);
-                if (attachment instanceof PSCommentAfter) {
-                    gen.commentln("%" + attachment.getContent());
+                Object attObj = extensionAttachments.get(i);
+                if (attObj instanceof PSExtensionAttachment) {
+                    PSExtensionAttachment attachment = (PSExtensionAttachment)attObj;
+                    if (attachment instanceof PSCommentAfter) {
+                        gen.commentln("%" + attachment.getContent());
+                    }
                 }
             }
         }



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