pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1850791 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Tue, 08 Jan 2019 20:19:30 GMT
Author: tilman
Date: Tue Jan  8 20:19:30 2019
New Revision: 1850791

URL: http://svn.apache.org/viewvc?rev=1850791&view=rev
Log:
PDFBOX-4399: reduce levels

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1850791&r1=1850790&r2=1850791&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Tue Jan
 8 20:19:30 2019
@@ -1606,26 +1606,28 @@ public class PageDrawer extends PDFGraph
         if (nestedHiddenOCGCount > 0)
         {
             nestedHiddenOCGCount++;
+            return;
         }
-        else if (tag != null && getPage().getResources() != null)
+        if (tag == null || getPage().getResources() == null)
         {
-            PDPropertyList propertyList = getPage().getResources().getProperties(tag);
-            if (propertyList instanceof PDOptionalContentGroup)
+            return;
+        }
+        PDPropertyList propertyList = getPage().getResources().getProperties(tag);
+        if (propertyList instanceof PDOptionalContentGroup)
+        {
+            PDOptionalContentGroup group = (PDOptionalContentGroup) propertyList;
+            RenderState printState = group.getRenderState(destination);
+            if (printState == null)
             {
-                PDOptionalContentGroup group = (PDOptionalContentGroup) propertyList;
-                RenderState printState = group.getRenderState(destination);
-                if (printState == null)
-                {
-                    if (!getRenderer().isGroupEnabled(group))
-                    {
-                        nestedHiddenOCGCount = 1;
-                    }
-                }
-                else if (RenderState.OFF.equals(printState))
+                if (!getRenderer().isGroupEnabled(group))
                 {
                     nestedHiddenOCGCount = 1;
                 }
             }
+            else if (RenderState.OFF.equals(printState))
+            {
+                nestedHiddenOCGCount = 1;
+            }
         }
     }
 



Mime
View raw message