pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857864 - in /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox: pdfwriter/COSWriter.java pdmodel/fdf/FDFPage.java
Date Sat, 20 Apr 2019 11:50:06 GMT
Author: tilman
Date: Sat Apr 20 11:50:05 2019
New Revision: 1857864

URL: http://svn.apache.org/viewvc?rev=1857864&view=rev
Log:
PDFBOX-4521: avoid ClassCastException

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1857864&r1=1857863&r2=1857864&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Sat
Apr 20 11:50:05 2019
@@ -428,9 +428,9 @@ public class COSWriter implements ICOSVi
     protected void doWriteBody(COSDocument doc) throws IOException
     {
         COSDictionary trailer = doc.getTrailer();
-        COSDictionary root = (COSDictionary)trailer.getDictionaryObject( COSName.ROOT );
-        COSDictionary info = (COSDictionary)trailer.getDictionaryObject( COSName.INFO );
-        COSDictionary encrypt = (COSDictionary)trailer.getDictionaryObject( COSName.ENCRYPT
);
+        COSDictionary root = trailer.getCOSDictionary(COSName.ROOT);
+        COSDictionary info = trailer.getCOSDictionary(COSName.INFO);
+        COSDictionary encrypt = trailer.getCOSDictionary(COSName.ENCRYPT);
         if( root != null )
         {
             addObjectToWrite( root );

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java?rev=1857864&r1=1857863&r2=1857864&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFPage.java Sat
Apr 20 11:50:05 2019
@@ -102,7 +102,7 @@ public class FDFPage implements COSObjec
     public FDFPageInfo getPageInfo()
     {
         FDFPageInfo retval = null;
-        COSDictionary dict = (COSDictionary) page.getDictionaryObject(COSName.INFO);
+        COSDictionary dict = page.getCOSDictionary(COSName.INFO);
         if (dict != null)
         {
             retval = new FDFPageInfo(dict);



Mime
View raw message