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 ac...@apache.org on 2008/07/07 14:36:58 UTC
svn commit: r674468 -
/xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/PDFDocument.java
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