pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1798493 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Date Mon, 12 Jun 2017 17:17:55 GMT
Author: tilman
Date: Mon Jun 12 17:17:55 2017
New Revision: 1798493

URL: http://svn.apache.org/viewvc?rev=1798493&view=rev
Log:
PDFBOX-3828: merge if statements

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java?rev=1798493&r1=1798492&r2=1798493&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/AppearanceGeneratorHelper.java
Mon Jun 12 17:17:55 2017
@@ -607,16 +607,13 @@ class AppearanceGeneratorHelper
         List<String> values = ((PDListBox) field).getValue();
         List<String> options = ((PDListBox) field).getOptionsExportValues();
         
-        if (!values.isEmpty() && !options.isEmpty())
+        if (!values.isEmpty() && !options.isEmpty() && indexEntries.isEmpty())
         {
-            if (indexEntries.isEmpty())
+            // create indexEntries from options
+            indexEntries = new ArrayList<Integer>();
+            for (String v : values)
             {
-                // create indexEntries from options
-                indexEntries = new ArrayList<Integer>();
-                for (String v : values)
-                {
-                    indexEntries.add(options.indexOf(v));
-                }
+                indexEntries.add(options.indexOf(v));
             }
         }
 



Mime
View raw message