diff options
author | Jeremias Maerki <jeremias@apache.org> | 2007-10-26 07:32:50 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2007-10-26 07:32:50 +0000 |
commit | bbad9cfcfc18d6523878c6d1ec6e924a911a0995 (patch) | |
tree | 7a62230a9fa9c83fcfa59aa14edc286b1febc086 /src/java | |
parent | 56e353c84408e2965109cba8f0c4297062b527da (diff) | |
download | xmlgraphics-fop-bbad9cfcfc18d6523878c6d1ec6e924a911a0995.tar.gz xmlgraphics-fop-bbad9cfcfc18d6523878c6d1ec6e924a911a0995.zip |
Fix for ClassCastException if non-PS extension attachments are encountered.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@588545 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/render/ps/PSRenderer.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java index 57a24a2e4..9e224a9b2 100644 --- a/src/java/org/apache/fop/render/ps/PSRenderer.java +++ b/src/java/org/apache/fop/render/ps/PSRenderer.java @@ -1055,10 +1055,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer implements ImageAda 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 @@ public class PSRenderer extends AbstractPathOrientedRenderer implements ImageAda 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()); + } } } } |