pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1831818 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
Date Thu, 17 May 2018 21:59:18 GMT
Author: tilman
Date: Thu May 17 21:59:18 2018
New Revision: 1831818

URL: http://svn.apache.org/viewvc?rev=1831818&view=rev
Log:
PDFBOX-4204: ignore all illegal OpenAction types

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1831818&r1=1831817&r2=1831818&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java
Thu May 17 21:59:18 2018
@@ -22,7 +22,6 @@ import java.util.List;
 
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSBase;
-import org.apache.pdfbox.cos.COSBoolean;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSObject;
@@ -251,22 +250,7 @@ public class PDDocumentCatalog implement
     public PDDestinationOrAction getOpenAction() throws IOException
     {
         COSBase openAction = root.getDictionaryObject(COSName.OPEN_ACTION);
-        if (openAction == null)
-        {
-            return null;
-        }
-        else if (openAction instanceof COSBoolean)
-        {
-            if (((COSBoolean) openAction).getValue() == false)
-            {
-                return null;
-            }
-            else
-            {
-                throw new IOException("Can't create OpenAction from COSBoolean");
-            }
-        }
-        else if (openAction instanceof COSDictionary)
+        if (openAction instanceof COSDictionary)
         {
             return PDActionFactory.createAction((COSDictionary)openAction);
         }
@@ -276,7 +260,7 @@ public class PDDocumentCatalog implement
         }
         else
         {
-            throw new IOException("Unknown OpenAction " + openAction);
+            return null;
         }
     }
     /**



Mime
View raw message