pdfbox-commits mailing list archives

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

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

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java?rev=1810266&r1=1810265&r2=1810266&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFParser.java Sun Oct 
1 12:34:37 2017
@@ -201,19 +201,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