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 2021/05/05 19:08:52 UTC
svn commit: r1889535 -
/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
Author: tilman
Date: Wed May 5 19:08:52 2021
New Revision: 1889535
URL: http://svn.apache.org/viewvc?rev=1889535&view=rev
Log:
PDFBOX-4892: remove redurant variable + simplify method, as suggested by valerybokov
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java?rev=1889535&r1=1889534&r2=1889535&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java Wed May 5 19:08:52 2021
@@ -91,8 +91,7 @@ public final class TextPosition
this.endX = endX;
this.endY = endY;
- int rotationAngle = pageRotation;
- this.rotation = rotationAngle;
+ this.rotation = pageRotation;
this.maxHeight = maxHeight;
this.pageHeight = pageHeight;
@@ -106,14 +105,14 @@ public final class TextPosition
this.fontSize = fontSize;
this.fontSizePt = fontSizeInPt;
- x = getXRot(rotationAngle);
- if (rotationAngle == 0 || rotationAngle == 180)
+ x = getXRot(rotation);
+ if (rotation == 0 || rotation == 180)
{
- y = this.pageHeight - getYLowerLeftRot(rotationAngle);
+ y = this.pageHeight - getYLowerLeftRot(rotation);
}
else
{
- y = this.pageWidth - getYLowerLeftRot(rotationAngle);
+ y = this.pageWidth - getYLowerLeftRot(rotation);
}
}
@@ -668,7 +667,7 @@ public final class TextPosition
private void insertDiacritic(int i, TextPosition diacritic)
{
StringBuilder sb = new StringBuilder();
- sb.append(unicode.substring(0, i));
+ sb.append(unicode, 0, i);
float[] widths2 = new float[widths.length + 1];
System.arraycopy(widths, 0, widths2, 0, i);