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 9B124200BBD for ; Tue, 8 Nov 2016 22:43:13 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 99A53160B0A; Tue, 8 Nov 2016 21:43:13 +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 DFB10160AD0 for ; Tue, 8 Nov 2016 22:43:12 +0100 (CET) Received: (qmail 85988 invoked by uid 500); 8 Nov 2016 21:43:12 -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 85979 invoked by uid 99); 8 Nov 2016 21:43:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 21:43:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 90F57181A76 for ; Tue, 8 Nov 2016 21:43:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id N0d4SssJB4g5 for ; Tue, 8 Nov 2016 21:43:10 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 7CAF55FB0B for ; Tue, 8 Nov 2016 21:43:10 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CCF3FE043E for ; Tue, 8 Nov 2016 21:42:39 +0000 (UTC) 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 CB5C43A3971 for ; Tue, 8 Nov 2016 21:42:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1768789 - /pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java Date: Tue, 08 Nov 2016 21:42:39 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161108214239.CB5C43A3971@svn01-us-west.apache.org> archived-at: Tue, 08 Nov 2016 21:43:13 -0000 Author: tilman Date: Tue Nov 8 21:42:39 2016 New Revision: 1768789 URL: http://svn.apache.org/viewvc?rev=1768789&view=rev Log: PDFBOX-2852: add missing type arguments, as suggested by Lorenz Pahl Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java?rev=1768789&r1=1768788&r2=1768789&view=diff ============================================================================== --- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java (original) +++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java Tue Nov 8 21:42:39 2016 @@ -33,6 +33,7 @@ import org.apache.pdfbox.pdmodel.graphic import org.apache.pdfbox.preflight.PreflightContext; import org.apache.pdfbox.preflight.content.PreflightStreamEngine; import org.apache.pdfbox.contentstream.operator.Operator; +import org.apache.pdfbox.cos.COSBase; /** * This class is used to parse a glyph of a Type3 font program. If the glyph is parsed without error, the width of the @@ -85,7 +86,7 @@ public class PreflightType3Stream extend * If there is an error processing the operation. */ @Override - protected void processOperator(Operator operator, List operands) throws IOException + protected void processOperator(Operator operator, List operands) throws IOException { super.processOperator(operator, operands); String operation = operator.getName(); @@ -102,9 +103,7 @@ public class PreflightType3Stream extend if (operation.equals("d0")) { - checkType3FirstOperator(operands); - } else if (operation.equals("d1")) { @@ -136,19 +135,15 @@ public class PreflightType3Stream extend * @param arguments * @throws IOException */ - private void checkType3FirstOperator(List arguments) throws IOException + private void checkType3FirstOperator(List arguments) throws IOException { if (!firstOperator) { throw new IOException("Type3 CharProc : First operator must be d0 or d1"); } - Object obj = arguments.get(0); - if (obj instanceof Number) - { - width = ((Number) obj).intValue(); - } - else if (obj instanceof COSNumber) + COSBase obj = arguments.get(0); + if (obj instanceof COSNumber) { width = ((COSNumber) obj).floatValue(); }