pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1768788 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java
Date Tue, 08 Nov 2016 21:42:34 GMT
Author: tilman
Date: Tue Nov  8 21:42:34 2016
New Revision: 1768788

URL: http://svn.apache.org/viewvc?rev=1768788&view=rev
Log:
PDFBOX-2852: add missing type arguments, as suggested by Lorenz Pahl

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java?rev=1768788&r1=1768787&r2=1768788&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/font/util/PreflightType3Stream.java
Tue Nov  8 21:42:34 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<COSBase> 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<COSBase> 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();
         }



Mime
View raw message