Browse Source

Fixed a couple minor bugs in CLI and config parsing


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1371734 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_0
Mehdi Houshmand 11 years ago
parent
commit
978313b554

+ 13
- 8
src/java/org/apache/fop/cli/CommandLineOptions.java View File

import org.apache.fop.apps.FopConfParser; import org.apache.fop.apps.FopConfParser;
import org.apache.fop.apps.FopFactory; import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.FopFactoryBuilder; import org.apache.fop.apps.FopFactoryBuilder;
import org.apache.fop.apps.FopFactoryConfig;
import org.apache.fop.apps.MimeConstants; import org.apache.fop.apps.MimeConstants;
import org.apache.fop.pdf.PDFAMode; import org.apache.fop.pdf.PDFAMode;
import org.apache.fop.pdf.PDFEncryptionManager; import org.apache.fop.pdf.PDFEncryptionManager;
/* rendering options (for the user agent) */ /* rendering options (for the user agent) */
private Map renderingOptions = new java.util.HashMap(); private Map renderingOptions = new java.util.HashMap();
/* target resolution (for the user agent) */ /* target resolution (for the user agent) */
private int targetResolution = 0;
private float targetResolution = FopFactoryConfig.DEFAULT_TARGET_RESOLUTION;


private boolean strictValidation = true; private boolean strictValidation = true;
/* control memory-conservation policy */ /* control memory-conservation policy */


private boolean flushCache = false; private boolean flushCache = false;


private URI baseURI = new File(".").toURI();
private URI baseURI = new File(".").getAbsoluteFile().toURI();


/** /**
* Construct a command line option object. * Construct a command line option object.
this.useStdIn = true; this.useStdIn = true;
} else { } else {
fofile = new File(filename); fofile = new File(filename);
baseURI = fofile.toURI();
baseURI = getBaseURI(fofile);
} }
return 1; return 1;
} }
this.useStdIn = true; this.useStdIn = true;
} else { } else {
xmlfile = new File(filename); xmlfile = new File(filename);
baseURI = xmlfile.toURI();
baseURI = getBaseURI(xmlfile);
} }
return 1; return 1;
} }
} }


private URI getBaseURI(File file) {
return file.getAbsoluteFile().getParentFile().toURI();
}

private int parseAWTOutputOption(String[] args, int i) throws FOPException { private int parseAWTOutputOption(String[] args, int i) throws FOPException {
setOutputMode(MimeConstants.MIME_FOP_AWT_PREVIEW); setOutputMode(MimeConstants.MIME_FOP_AWT_PREVIEW);
return 0; return 0;
this.useStdIn = true; this.useStdIn = true;
} else { } else {
fofile = new File(filename); fofile = new File(filename);
baseURI = fofile.toURI();
baseURI = getBaseURI(fofile);
} }
} else if (outputmode == null) { } else if (outputmode == null) {
outputmode = MimeConstants.MIME_PDF; outputmode = MimeConstants.MIME_PDF;
this.useStdIn = true; this.useStdIn = true;
} else { } else {
areatreefile = new File(filename); areatreefile = new File(filename);
baseURI = areatreefile.toURI();
baseURI = getBaseURI(areatreefile);
} }
return 1; return 1;
} }
this.useStdIn = true; this.useStdIn = true;
} else { } else {
iffile = new File(filename); iffile = new File(filename);
baseURI = iffile.toURI();
baseURI = getBaseURI(iffile);
} }
return 1; return 1;
} }
this.useStdIn = true; this.useStdIn = true;
} else { } else {
imagefile = new File(filename); imagefile = new File(filename);
baseURI = imagefile.toURI();
baseURI = getBaseURI(imagefile);
} }
return 1; return 1;
} }

+ 1
- 1
src/java/org/apache/fop/fonts/DefaultFontConfig.java View File

} else { } else {
this.strict = strict; this.strict = strict;
this.fontInfoCfg = cfg.getChild("fonts", false); this.fontInfoCfg = cfg.getChild("fonts", false);
instance = new DefaultFontConfig(cfg.getChild("auto-detect", false) != null);
instance = new DefaultFontConfig(fontInfoCfg.getChild("auto-detect", false) != null);
parse(); parse();
} }
} }

Loading…
Cancel
Save