pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1790148 - /pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
Date Tue, 04 Apr 2017 16:40:06 GMT
Author: tilman
Date: Tue Apr  4 16:40:06 2017
New Revision: 1790148

URL: http://svn.apache.org/viewvc?rev=1790148&view=rev
Log:
PDFBOX-2852: sonar fix

Modified:
    pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java

Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java?rev=1790148&r1=1790147&r2=1790148&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
(original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/content/PreflightStreamEngine.java
Tue Apr  4 16:40:06 2017
@@ -432,28 +432,23 @@ public abstract class PreflightStreamEng
             }
         }
         // fills
-        if ("f".equals(op) || "F".equals(op) || "f*".equals(op) || 
-            "B".equals(op) || "B*".equals(op) || "b".equals(op) || "b*".equals(op))
+        if (("f".equals(op) || "F".equals(op) || "f*".equals(op) || 
+            "B".equals(op) || "B*".equals(op) || "b".equals(op) || "b*".equals(op)) &&
+                getGraphicsState().getNonStrokingColor().getColorSpace() instanceof PDDeviceGray)
         {
-            if (getGraphicsState().getNonStrokingColor().getColorSpace() instanceof PDDeviceGray)
-            {
-                v = true;
-            }
+            v = true;
         }
         // strokes
-        if ("B".equals(op) || "B*".equals(op) || "b".equals(op) || "b*".equals(op) || 
-            "s".equals(op) || "S".equals(op))
+        if (("B".equals(op) || "B*".equals(op) || "b".equals(op) || "b*".equals(op) || 
+            "s".equals(op) || "S".equals(op)) &&
+                getGraphicsState().getStrokingColor().getColorSpace() instanceof PDDeviceGray)
         {
-            if (getGraphicsState().getStrokingColor().getColorSpace() instanceof PDDeviceGray)
-            {
-                v = true;
-            }
+            v = true;
         }
-        if (v)
+        if (v && !validColorSpaceDestOutputProfile(PreflightStreamEngine.ColorSpaceType.ALL))
         {
-            if (!validColorSpaceDestOutputProfile(PreflightStreamEngine.ColorSpaceType.ALL))
-                        registerError("/DeviceGray default for operator \"" + op + 
-                                "\" can't be used without Color Profile",
+            registerError("/DeviceGray default for operator \"" + op
+                    + "\" can't be used without Color Profile",
                     ERROR_GRAPHIC_INVALID_COLOR_SPACE_MISSING);
         }
     }



Mime
View raw message