You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/11/04 22:18:02 UTC
svn commit: r1636738 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
Author: tilman
Date: Tue Nov 4 21:18:01 2014
New Revision: 1636738
URL: http://svn.apache.org/r1636738
Log:
PDFBOX-2470: translate comments, clean up code
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1636738&r1=1636737&r2=1636738&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Tue Nov 4 21:18:01 2014
@@ -208,7 +208,7 @@ public class PDDocument implements Pagea
// these cases occur when we have a page, not an array of pages
String objStr = String.valueOf(thePageOrArrayObject.getObjectNumber().intValue());
String genStr = String.valueOf(thePageOrArrayObject.getGenerationNumber().intValue());
- getPageMap().put(objStr+","+genStr, new Integer(getPageMap().size()+1));
+ getPageMap().put(objStr+","+genStr, getPageMap().size()+1);
}
else
{
@@ -222,7 +222,7 @@ public class PDDocument implements Pagea
COSObject thisObject = (COSObject)kidsArray.get(i);
String objStr = String.valueOf(thisObject.getObjectNumber().intValue());
String genStr = String.valueOf(thisObject.getGenerationNumber().intValue());
- getPageMap().put(objStr+","+genStr, new Integer(getPageMap().size()+1));
+ getPageMap().put(objStr+","+genStr, getPageMap().size()+1);
}
}
else
@@ -331,7 +331,7 @@ public class PDDocument implements Pagea
rootPages.getAllKids(kids);
int size = (int)rootPages.getCount();
- PDPage page = null;
+ PDPage page;
if (size == 0)
{
throw new SignatureException(SignatureException.INVALID_PAGE_FOR_SIGNATURE, "The PDF file has no pages");
@@ -484,13 +484,13 @@ public class PDDocument implements Pagea
{
COSDictionary cosBaseDict = (COSDictionary)base;
- // Appearance Dictionary auslesen und setzen
+ // read and set Appearance Dictionary
PDAppearanceDictionary ap =
new PDAppearanceDictionary((COSDictionary)cosBaseDict.getItem(COSName.AP));
ap.getDictionary().setDirect(true);
signatureField.getWidget().setAppearance(ap);
- // AcroForm DefaultRessource auslesen und setzen
+ // read and set AcroForm DefaultRessource
COSBase dr = cosBaseDict.getItem(COSName.DR);
dr.setDirect(true);
dr.setNeedToBeUpdate(true);
@@ -663,7 +663,7 @@ public class PDDocument implements Pagea
os = dest.createOutputStream();
byte[] buf = new byte[10240];
- int amountRead = 0;
+ int amountRead;
is = src.createInputStream();
while((amountRead = is.read(buf,0,10240)) > -1)
{