pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1654872 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
Date Mon, 26 Jan 2015 19:05:31 GMT
Author: lehmi
Date: Mon Jan 26 19:05:31 2015
New Revision: 1654872

URL: http://svn.apache.org/r1654872
Log:
PDFBOX-2595: use the firstID as secondID if the ID is created for the first time

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java?rev=1654872&r1=1654871&r2=1654872&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/COSWriter.java Mon Jan 26
19:05:31 2015
@@ -1266,7 +1266,8 @@ public class COSWriter implements ICOSVi
             }
             // reuse origin documentID if available as first value
             COSString firstID = missingID ? new COSString( md5.digest() ) : (COSString)idArray.get(0);
-            COSString secondID = new COSString( md5.digest() );
+            // it's ok to use the same ID for the second part if the ID is created for the
first time
+            COSString secondID = missingID ? firstID : new COSString( md5.digest() );
             idArray = new COSArray();
             idArray.add( firstID );
             idArray.add( secondID );



Mime
View raw message