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 2017/06/15 15:50:17 UTC
svn commit: r1798848 -
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Author: tilman
Date: Thu Jun 15 15:50:16 2017
New Revision: 1798848
URL: http://svn.apache.org/viewvc?rev=1798848&view=rev
Log:
PDFBOX-2852: remove tabs, remove unused assignments, use jdk7 syntax
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1798848&r1=1798847&r2=1798848&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java Thu Jun 15 15:50:16 2017
@@ -160,15 +160,15 @@ class AppearanceGeneratorHelper
{
defaultAppearance = getWidgetDefaultAppearanceString(widget);
}
-
- PDRectangle rect = widget.getRectangle();
+
+ PDRectangle rect = widget.getRectangle();
if (rect == null)
{
- widget.getCOSObject().removeItem(COSName.AP);
+ widget.getCOSObject().removeItem(COSName.AP);
LOG.warn("widget of field " + field.getFullyQualifiedName() + " has no rectangle, no appearance stream created");
continue;
}
-
+
PDFormFieldAdditionalActions actions = field.getActions();
// in case all tests fail the field will be formatted by acrobat
@@ -461,7 +461,8 @@ class AppearanceGeneratorHelper
// special handling for comb boxes as these are like table cells with individual
// chars
- if (shallComb()) {
+ if (shallComb())
+ {
insertGeneratedCombAppearance(contents, appearanceStream, font, fontSize);
}
else if (field instanceof PDListBox)
@@ -574,16 +575,13 @@ class AppearanceGeneratorHelper
(appearanceStream.getBBox().getHeight() - ascentAtFontSize)/2;
float prevCharWidth = 0f;
- float currCharWidth = 0f;
- float xOffset = combWidth/2;
+ float xOffset = combWidth / 2;
- String combString = "";
-
for (int i = 0; i < numChars; i++)
{
- combString = value.substring(i, i+1);
- currCharWidth = font.getStringWidth(combString) / FONTSCALE * fontSize/2;
+ String combString = value.substring(i, i+1);
+ float currCharWidth = font.getStringWidth(combString) / FONTSCALE * fontSize/2;
xOffset = xOffset + prevCharWidth/2 - currCharWidth/2;
@@ -780,4 +778,4 @@ class AppearanceGeneratorHelper
box.getWidth() - 2 * padding,
box.getHeight() - 2 * padding);
}
-}
\ No newline at end of file
+}