pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1798846 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Date Thu, 15 Jun 2017 15:44:11 GMT
Author: tilman
Date: Thu Jun 15 15:44:11 2017
New Revision: 1798846

URL: http://svn.apache.org/viewvc?rev=1798846&view=rev
Log:
PDFBOX-2852: remove tabs, remove unused assignments

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1798846&r1=1798845&r2=1798846&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Thu Jun 15 15:44:11 2017
@@ -151,7 +151,7 @@ class AppearanceGeneratorHelper
 
         for (PDAnnotationWidget widget : field.getWidgets())
         {
-        	// some fields have the /Da at the widget level if the 
+            // some fields have the /Da at the widget level if the 
             // widgets differ in layout.
             PDDefaultAppearanceString acroFormAppearance = defaultAppearance;
             
@@ -159,15 +159,15 @@ class AppearanceGeneratorHelper
             {
                 defaultAppearance = getWidgetDefaultAppearanceString(widget);
             }
-        	
+
             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
@@ -463,7 +463,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)
@@ -578,16 +579,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;
             



Mime
View raw message