pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1810265 - in /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser: COSParser.java PDFParser.java
Date Sun, 01 Oct 2017 12:34:24 GMT
Author: lehmi
Date: Sun Oct  1 12:34:23 2017
New Revision: 1810265

URL: http://svn.apache.org/viewvc?rev=1810265&view=rev
Log:
PDFBOX-2852: removed unneeded calls

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java?rev=1810265&r1=1810264&r2=1810265&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java Sun
Oct  1 12:34:23 2017
@@ -2343,7 +2343,7 @@ public class COSParser extends BaseParse
         {
             throw new IOException("Missing root object specification in trailer.");
         }
-        return parseObjectDynamically(root, false);
+        return root.getObject();
     }
 
 }

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java?rev=1810265&r1=1810264&r2=1810265&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Sun
Oct  1 12:34:23 2017
@@ -235,19 +235,16 @@ public class PDFParser extends COSParser
         {
             root.setItem(COSName.TYPE, COSName.CATALOG);
         }
-        COSObject catalogObj = document.getCatalog();
-        if (catalogObj.getObject() instanceof COSDictionary)
+        // parse all objects, starting at the root dictionary
+        parseDictObjects(root, (COSName[]) null);
+        // parse all objects of the info dictionary
+        COSBase infoBase = trailer.getDictionaryObject(COSName.INFO);
+        if (infoBase instanceof COSDictionary)
         {
-            parseDictObjects((COSDictionary) catalogObj.getObject(), (COSName[]) null);
-            
-            COSBase infoBase = trailer.getDictionaryObject(COSName.INFO);
-            if (infoBase instanceof COSDictionary)
-            {
-                parseDictObjects((COSDictionary) infoBase, (COSName[]) null);
-            }
-            
-            document.setDecrypted();
+            parseDictObjects((COSDictionary) infoBase, (COSName[]) null);
         }
+
+        document.setDecrypted();
         initialParseDone = true;
     }
 



Mime
View raw message