xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acumis...@apache.org
Subject svn commit: r674468 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java
Date Mon, 07 Jul 2008 12:36:58 GMT
Author: acumiskey
Date: Mon Jul  7 05:36:57 2008
New Revision: 674468

URL: http://svn.apache.org/viewvc?rev=674468&view=rev
Log:
Possible NullPointerException avoided

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java?rev=674468&r1=674467&r2=674468&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java Mon Jul  7 05:36:57
2008
@@ -528,10 +528,10 @@
     public void setEncryption(PDFEncryptionParams params) {
         getProfile().verifyEncryptionAllowed();
         this.encryption = PDFEncryptionManager.newInstance(++this.objectcount, params);
-        ((PDFObject)this.encryption).setDocument(this);
         if (encryption != null) {
-            /**@todo this cast is ugly. PDFObject should be transformed to an interface.
*/
-            addTrailerObject((PDFObject)this.encryption);
+            PDFObject pdfObject = (PDFObject)encryption;
+            pdfObject.setDocument(this);
+            addTrailerObject(pdfObject);
         } else {
             log.warn(
                 "PDF encryption is unavailable. PDF will be "



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