pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1792839 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.java
Date Thu, 27 Apr 2017 05:24:07 GMT
Author: lehmi
Date: Thu Apr 27 05:24:06 2017
New Revision: 1792839

URL: http://svn.apache.org/viewvc?rev=1792839&view=rev
Log:
PDFBOX-3318: don't stop searching, there might be other versions of the objects we are looking
for

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/COSParser.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=1792839&r1=1792838&r2=1792839&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 Thu
Apr 27 05:24:06 2017
@@ -1746,8 +1746,6 @@ public class COSParser extends BaseParse
             }
             getDocument().setTrailer(trailer);
             // search for the different parts of the trailer dictionary
-            boolean catalogFound = false;
-            boolean infoFound = false;
             for (Entry<COSObjectKey, Long> entry : bfSearchCOSObjectKeyOffsets.entrySet())
             {
                 Long offset = entry.getValue();
@@ -1764,7 +1762,6 @@ public class COSParser extends BaseParse
                         if (COSName.CATALOG.equals(dictionary.getCOSName(COSName.TYPE)))
                         {
                             trailer.setItem(COSName.ROOT, document.getObjectFromPool(entry.getKey()));
-                            catalogFound = true;
                         }
                         // info dictionary
                         else if (dictionary.containsKey(COSName.MOD_DATE) && 
@@ -1777,15 +1774,9 @@ public class COSParser extends BaseParse
                                 || dictionary.containsKey(COSName.CREATION_DATE)))
                         {
                             trailer.setItem(COSName.INFO, document.getObjectFromPool(entry.getKey()));
-                            infoFound = true;
                         }
                         // TODO encryption dictionary
                     }
-                    if (catalogFound && infoFound)
-                    {
-                        // all objects found, stop searching
-                        break;
-                    }
                 }
                 catch(IOException exception)
                 {



Mime
View raw message