pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1840594 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
Date Tue, 11 Sep 2018 17:16:25 GMT
Author: tilman
Date: Tue Sep 11 17:16:25 2018
New Revision: 1840594

URL: http://svn.apache.org/viewvc?rev=1840594&view=rev
Log:
PDFBOX-4071: simplify code

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java?rev=1840594&r1=1840593&r2=1840594&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/PDFTextStripper.java Tue Sep
11 17:16:25 2018
@@ -600,14 +600,7 @@ public class PDFTextStripper extends Leg
                 float expectedStartOfNextWordX = EXPECTED_START_OF_NEXT_WORD_X_RESET_VALUE;
                 if (Float.compare(endOfLastTextX, END_OF_LAST_TEXT_X_RESET_VALUE) != 0)
                 {
-                    if (deltaCharWidth > deltaSpace)
-                    {
-                        expectedStartOfNextWordX = endOfLastTextX + deltaSpace;
-                    }
-                    else
-                    {
-                        expectedStartOfNextWordX = endOfLastTextX + deltaCharWidth;
-                    }
+                    expectedStartOfNextWordX = endOfLastTextX + Math.min(deltaSpace, deltaCharWidth);
                 }
 
                 if (lastPosition != null)



Mime
View raw message