Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3BEAE200CA8 for ; Thu, 15 Jun 2017 17:44:17 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3A5A3160BDF; Thu, 15 Jun 2017 15:44:17 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 81314160BC4 for ; Thu, 15 Jun 2017 17:44:16 +0200 (CEST) Received: (qmail 47775 invoked by uid 500); 15 Jun 2017 15:44:15 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 47764 invoked by uid 99); 15 Jun 2017 15:44:15 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 15:44:15 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id E6C653A0350 for ; Thu, 15 Jun 2017 15:44:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170615154413.E6C653A0350@svn01-us-west.apache.org> archived-at: Thu, 15 Jun 2017 15:44:17 -0000 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;