pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1866158 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java
Date Fri, 30 Aug 2019 17:49:46 GMT
Author: tilman
Date: Fri Aug 30 17:49:46 2019
New Revision: 1866158

URL: http://svn.apache.org/viewvc?rev=1866158&view=rev
Log:
PDFBOX-4071: optimize set iteration

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java?rev=1866158&r1=1866157&r2=1866158&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripperByArea.java
Fri Aug 30 17:49:46 2019
@@ -135,15 +135,15 @@ public class PDFTextStripperByArea exten
      * {@inheritDoc}
      */
     @Override
-    protected void processTextPosition( TextPosition text )
+    protected void processTextPosition(TextPosition text)
     {
-        for (String region : regionArea.keySet())
+        for (Map.Entry<String, Rectangle2D> regionAreaEntry : regionArea.entrySet())
         {
-            Rectangle2D rect = regionArea.get( region );
-            if( rect.contains( text.getX(), text.getY() ) )
+            Rectangle2D rect = regionAreaEntry.getValue();
+            if (rect.contains(text.getX(), text.getY()))
             {
-                charactersByArticle = regionCharacterList.get( region );
-                super.processTextPosition( text );
+                charactersByArticle = regionCharacterList.get(regionAreaEntry.getKey());
+                super.processTextPosition(text);
             }
         }
     }



Mime
View raw message