PDFBOX-4892: remove redurant variable + simplify method, as suggested by valerybokov
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1889536 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java b/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
index bd338ca..ea8cc01 100644
--- a/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
+++ b/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
@@ -91,8 +91,7 @@
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 @@
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 @@
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);