pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1760242 - in /pdfbox/branches/2.0: ./ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/ tools/src/main/java/org/apache/pdfbox/tools/
Date Sun, 11 Sep 2016 11:20:48 GMT
Author: tilman
Date: Sun Sep 11 11:20:47 2016
New Revision: 1760242

URL: http://svn.apache.org/viewvc?rev=1760242&view=rev
Log:
PDFBOX-2852: use foreach loop, as suggested by Simon Steiner

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/RC4Cipher.java
    pdfbox/branches/2.0/pom.xml
    pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PDFText2HTML.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java?rev=1760242&r1=1760241&r2=1760242&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/taggedpdf/PDStandardAttributeObject.java
Sun Sep 11 11:20:47 2016
@@ -365,9 +365,9 @@ public abstract class PDStandardAttribut
     protected void setArrayOfNumber(String name, float[] values)
     {
         COSArray array = new COSArray();
-        for (int i = 0; i < values.length; i++)
+        for (float value : values)
         {
-            array.add(new COSFloat(values[i]));
+            array.add(new COSFloat(value));
         }
         COSBase oldBase = this.getCOSObject().getDictionaryObject(name);
         this.getCOSObject().setItem(name, array);

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/RC4Cipher.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/RC4Cipher.java?rev=1760242&r1=1760241&r2=1760242&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/RC4Cipher.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/RC4Cipher.java
Sun Sep 11 11:20:47 2016
@@ -122,9 +122,9 @@ class RC4Cipher
      */
     public void write( byte[] data, OutputStream output ) throws IOException
     {
-        for( int i = 0; i < data.length; i++ )
+        for (byte aData : data)
         {
-            write( data[i], output );
+            write(aData, output);
         }
     }
 

Modified: pdfbox/branches/2.0/pom.xml
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pom.xml?rev=1760242&r1=1760241&r2=1760242&view=diff
==============================================================================
--- pdfbox/branches/2.0/pom.xml (original)
+++ pdfbox/branches/2.0/pom.xml Sun Sep 11 11:20:47 2016
@@ -30,7 +30,7 @@
   <artifactId>pdfbox-reactor</artifactId>
   <packaging>pom</packaging>
 
-  <name>PDFBox reactor</name>
+  <name>PDFBox reactor 2</name>
 
   <scm>
     <connection>

Modified: pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PDFText2HTML.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PDFText2HTML.java?rev=1760242&r1=1760241&r2=1760242&view=diff
==============================================================================
--- pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PDFText2HTML.java (original)
+++ pdfbox/branches/2.0/tools/src/main/java/org/apache/pdfbox/tools/PDFText2HTML.java Sun
Sep 11 11:20:47 2016
@@ -113,11 +113,8 @@ public class PDFText2HTML extends PDFTex
             StringBuilder titleText = new StringBuilder();
             while (textIter.hasNext())
             {
-                Iterator<TextPosition> textByArticle = textIter.next().iterator();
-                while (textByArticle.hasNext())
+                for (TextPosition position : textIter.next())
                 {
-                    TextPosition position = textByArticle.next();
-
                     float currentFontSize = position.getFontSize();
                     //If we're past 64 chars we will assume that we're past the title
                     //64 is arbitrary



Mime
View raw message