You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by lb...@apache.org on 2014/11/04 00:01:33 UTC

svn commit: r1636469 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java

Author: lbernardo
Date: Mon Nov  3 23:01:33 2014
New Revision: 1636469

URL: http://svn.apache.org/r1636469
Log:
FOP-2281: factory is not initialized when -cache is used in org.apache.fop.cli.Main; patch submitted by Thanasis Giannimaras.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=1636469&r1=1636468&r2=1636469&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/cli/CommandLineOptions.java Mon Nov  3 23:01:33 2014
@@ -142,6 +142,8 @@ public class CommandLineOptions {
 
     private URI baseURI = new File(".").getAbsoluteFile().toURI();
 
+    private String cacheName;
+
     /**
      * Construct a command line option object.
      */
@@ -288,7 +290,7 @@ public class CommandLineOptions {
             } else if (args[i].equals("-flush")) {
                 flushCache = true;
             } else if (args[i].equals("-cache")) {
-                parseCacheOption(args, i);
+                i = i + parseCacheOption(args, i);
             } else if (args[i].equals("-dpi")) {
                 i = i + parseResolution(args, i);
             } else if (args[i].equals("-q") || args[i].equals("--quiet")) {
@@ -410,7 +412,7 @@ public class CommandLineOptions {
             throw new FOPException("if you use '-cache', you must specify "
               + "the name of the font cache file");
         } else {
-            factory.getFontManager().setCacheFile(URI.create(args[i + 1]));
+            cacheName = args[i + 1];
             return 1;
         }
     }
@@ -1037,6 +1039,9 @@ public class CommandLineOptions {
             }
         }
         factory = fopFactoryBuilder.build();
+        if (cacheName != null) {
+            factory.getFontManager().setCacheFile(URI.create(cacheName));
+        }
      }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org