pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1677114 - /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java
Date Fri, 01 May 2015 11:36:23 GMT
Author: tilman
Date: Fri May  1 11:36:23 2015
New Revision: 1677114

URL: http://svn.apache.org/r1677114
Log:
PDFBOX-2783: Use getCOSObject() instead of getCOSDictionary()

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java?rev=1677114&r1=1677113&r2=1677114&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShaddingPatternValidationProcess.java
Fri May  1 11:36:23 2015
@@ -21,12 +21,12 @@
 
 package org.apache.pdfbox.preflight.process.reflect;
 
+import java.io.IOException;
+
 import static org.apache.pdfbox.preflight.PreflightConfiguration.EXTGSTATE_PROCESS;
 import static org.apache.pdfbox.preflight.PreflightConstants.ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE;
 import static org.apache.pdfbox.preflight.PreflightConstants.TRANPARENCY_DICTIONARY_KEY_EXTGSTATE;
 
-import java.io.IOException;
-
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.pdmodel.PDPage;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace;
@@ -46,6 +46,7 @@ import org.apache.pdfbox.preflight.utils
 public class ShaddingPatternValidationProcess extends AbstractProcess
 {
 
+    @Override
     public void validate(PreflightContext context) throws ValidationException
     {
         PreflightPath vPath = context.getValidationPath();
@@ -53,7 +54,7 @@ public class ShaddingPatternValidationPr
         {
             return;
         }
-        else if (!vPath.isExpectedType(PDShading.class))
+        if (!vPath.isExpectedType(PDShading.class))
         {
             context.addValidationError(new ValidationError(PreflightConstants.ERROR_GRAPHIC_MISSING_OBJECT,
                     "ShadingPattern validation required at least a PDResources"));
@@ -80,7 +81,7 @@ public class ShaddingPatternValidationPr
      */
     protected void checkColorSpace(PreflightContext context, PDPage page, PDShading shadingRes)
             throws ValidationException
-            {
+    {
         try
         {
             PDColorSpace pColorSpace = shadingRes.getColorSpace();
@@ -93,7 +94,7 @@ public class ShaddingPatternValidationPr
         {
             context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE,
e.getMessage()));
         }
-            }
+    }
 
     /**
      * Check the Extended Graphic State contains in the ShadingPattern dictionary if it is
present. To check this
@@ -106,12 +107,12 @@ public class ShaddingPatternValidationPr
      */
     protected void checkGraphicState(PreflightContext context, PDPage page, PDShading shadingRes)
             throws ValidationException
-            {
-        COSDictionary resources = (COSDictionary) shadingRes.getCOSDictionary().getDictionaryObject(
+    {
+        COSDictionary resources = (COSDictionary) shadingRes.getCOSObject().getDictionaryObject(
                 TRANPARENCY_DICTIONARY_KEY_EXTGSTATE);
         if (resources != null)
         {
             ContextHelper.validateElement(context, resources, EXTGSTATE_PROCESS);
         }
-            }
+    }
 }



Mime
View raw message