diff options
author | Luis Bernardo <lbernardo@apache.org> | 2014-11-03 23:01:33 +0000 |
---|---|---|
committer | Luis Bernardo <lbernardo@apache.org> | 2014-11-03 23:01:33 +0000 |
commit | 471fdf76e5d8c2967f648436c3390b1cb37607a1 (patch) | |
tree | 77111e652fa8a987497601360ee7474233f643f3 /src | |
parent | 27e1fd7e26ccbf75f27cbbdd3607f00a927cb32c (diff) | |
download | xmlgraphics-fop-471fdf76e5d8c2967f648436c3390b1cb37607a1.tar.gz xmlgraphics-fop-471fdf76e5d8c2967f648436c3390b1cb37607a1.zip |
FOP-2281: factory is not initialized when -cache is used in org.apache.fop.cli.Main; patch submitted by Thanasis Giannimaras.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1636469 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/cli/CommandLineOptions.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java index 6e9eeabdc..6932333ea 100644 --- a/src/java/org/apache/fop/cli/CommandLineOptions.java +++ b/src/java/org/apache/fop/cli/CommandLineOptions.java @@ -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)); + } } /** |