aboutsummaryrefslogtreecommitdiff
blob: 18bdaac1d5bd4dd5969f35d42444b6dd2f24d203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Bryan Gardiner <bog@khumba.net>
Project-Bug-URL: https://bugzilla.scilab.org/show_bug.cgi?id=14009
Gentoo-Bug-URL: https://github.com/gentoo-science/sci/pull/456

Updates Scilab to build against FOP >=2.0.  This is not tested, as I'm not sure
of a test case, and it's awaiting upstream review.

--- a/modules/helptools/src/java/org/scilab/modules/helptools/FopConverter.java
+++ b/modules/helptools/src/java/org/scilab/modules/helptools/FopConverter.java
@@ -43,10 +43,10 @@ public class FopConverter extends ContainerConverter {
         String fileName = outputDirectory + "/" + baseName + "." + format.name().toLowerCase();
 
         try {
-            FopFactory fopFactory = FopFactory.newInstance();
+            FopFactory fopFactory =
+                FopFactory.newInstance(new File(System.getenv("SCI") + "/modules/helptools/etc/fopconf.xml"));
             fopFactory.addElementMapping(new JLaTeXMathElementMapping());
             fopFactory.getXMLHandlerRegistry().addXMLHandler(new JLaTeXMathXMLHandler());
-            fopFactory.setUserConfig(new File(System.getenv("SCI") + "/modules/helptools/etc/fopconf.xml"));
 
             // Step 3: Construct fop with desired output format
             OutputStream out = new BufferedOutputStream(new FileOutputStream(fileName));
--- a/modules/scinotes/src/java/org/scilab/modules/scinotes/utils/CodeExporter.java
+++ b/modules/scinotes/src/java/org/scilab/modules/scinotes/utils/CodeExporter.java
@@ -114,11 +114,11 @@ public class CodeExporter extends FOCodeConverter {
      * @param format the page format
      */
     public void convert(String code, int[] lineNumberArray, String fileName, String type, String title, PageFormat format) {
-        FopFactory fopFactory = FopFactory.newInstance();
         OutputStream out = null;
 
         try {
-            fopFactory.setUserConfig(new File(ScilabConstants.SCI + "/modules/helptools/etc/fopconf.xml"));
+            FopFactory fopFactory =
+                FopFactory.newInstance(new File(ScilabConstants.SCI + "/modules/helptools/etc/fopconf.xml"));
             FOUserAgent userAgent = fopFactory.newFOUserAgent();
             userAgent.setProducer(CREATOR);
             userAgent.setTitle(title);