r35263 - /packages/scilab/trunk/debian/patches/jeuclid.diff

sylvestre-guest at users.alioth.debian.org sylvestre-guest at users.alioth.debian.org
Tue Oct 14 15:11:42 UTC 2008


Author: sylvestre-guest
Date: Tue Oct 14 15:11:42 2008
New Revision: 35263

URL: http://svn.debian.org/wsvn/debian-science/?sc=1&rev=35263
Log:
Better patch to use the latest version of jeuclid without the ant stuff (mandatory for the target package)

Modified:
    packages/scilab/trunk/debian/patches/jeuclid.diff

Modified: packages/scilab/trunk/debian/patches/jeuclid.diff
URL: http://svn.debian.org/wsvn/debian-science/packages/scilab/trunk/debian/patches/jeuclid.diff?rev=35263&op=diff
==============================================================================
--- packages/scilab/trunk/debian/patches/jeuclid.diff (original)
+++ packages/scilab/trunk/debian/patches/jeuclid.diff Tue Oct 14 15:11:42 2008
@@ -1,17 +1,61 @@
---- scilab-5.0.2.orig/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java	2008/09/04 08:00:48	27268
-+++ scilab-5.0.2/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java	2008/10/06 14:38:09	28063
-@@ -45,9 +45,7 @@
+Index: org/scilab/modules/helptools/CopyConvert.java
+===================================================================
+--- scilab-5.0.2.orig/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java	(révision 27878)
++++ scilab-5.0.2/modules/helptools/src/java/org/scilab/modules/helptools/CopyConvert.java	(révision 28111)
+@@ -45,10 +45,13 @@
  import org.apache.batik.transcoder.image.ImageTranscoder;
  import org.apache.batik.transcoder.image.PNGTranscoder;
  
 -import net.sourceforge.jeuclid.MathBase;
 -import net.sourceforge.jeuclid.ParameterKey;
 -import net.sourceforge.jeuclid.Converter;
-+import net.sourceforge.jeuclid.ant.MathMLConverter;
++import net.sourceforge.jeuclid.context.Parameter;
++import net.sourceforge.jeuclid.LayoutContext;
++import net.sourceforge.jeuclid.MutableLayoutContext;
++import net.sourceforge.jeuclid.context.LayoutContextImpl;
++import net.sourceforge.jeuclid.converter.Converter;
  
++
  /**
   * @TODO add comment
-@@ -605,18 +603,19 @@
+  *
+@@ -323,7 +326,7 @@
+             mainOut = null;
+ 
+             if (extractedFile != null) {
+-                reportInfo("Extracted embedded graphics to '"
++                reportInfo("Extracted embedded graphics from '"+extractedFile+"' to '"
+                            + extractedFile + "'.");
+ 
+                 String converted = copyConvertGraphics(extractedFile);
+@@ -392,7 +395,7 @@
+             File convertedFile = new File(outDir, baseName);
+ 
+             if (!convertedFile.exists()) {
+-                reportInfo("Converting '" + graphicsFile + "' to '"
++                reportInfo("Converting TeX '" + graphicsFile + "' to '"
+                            + convertedFile + "'...");
+ 
+                 if (!convertTeX(graphicsFile, convertedFile)) {
+@@ -404,7 +407,7 @@
+             File convertedFile = new File(outDir, baseName);
+ 
+             if (!convertedFile.exists()) {
+-                reportInfo("Converting '" + graphicsFile + "' to '"
++                reportInfo("Converting MathML '" + graphicsFile + "' to '"
+                            + convertedFile + "'...");
+ 
+                 if (!convertMathML(graphicsFile, convertedFile)) {
+@@ -416,7 +419,7 @@
+             File convertedFile = new File(outDir, baseName);
+ 
+             if (!convertedFile.exists()) {
+-                reportInfo("Converting '" + graphicsFile + "' to '"
++                reportInfo("Converting SVG '" + graphicsFile + "' to '"
+                            + convertedFile + "'...");
+ 
+                 if (!convertSVG("svgz".equalsIgnoreCase(ext), graphicsFile, convertedFile)) {
+@@ -605,20 +608,19 @@
      }
  
      private boolean convertMathML(File inFile, File outFile) {
@@ -22,22 +66,22 @@
 -        // Workaround a XEP problem. FOP 1 is OK.
 -        convertParams.put(ParameterKey.BackgroundColor, "#FFFFFF");
 -        convertParams.put(ParameterKey.FontSize, "14");
--
-+		/* Set the misc value ... used to be done in MathBase in jeuclid version 3.0.X */
-+		MathMLConverter converter = new MathMLConverter();
-+		converter.setType("image/png");
-+		converter.setAntiAlias(true);
-+		converter.setBackgroundColor("#FFFFFF");
-+		converter.setFontSize(14);
-+		converter.setIn(inFile);
-+		converter.setOut(outFile);
-+		converter.execute();
++		MutableLayoutContext context = new LayoutContextImpl(LayoutContextImpl
++                .getDefaultLayoutContext());
++		context.setParameter(Parameter.ANTIALIAS,"true");
++		// Workaround a XEP problem. FOP 1 is OK.
++		context.setParameter(Parameter.MATHBACKGROUND,"#FFFFFF");
++		context.setParameter(Parameter.MATHSIZE,"14");
+ 
          try {
 -            Converter.convert(inFile, outFile, convertParams);
-+			
++            Converter.getInstance().convert(inFile, outFile, "image/png", context);
++
              return true;
--        } catch (IOException e) {
-+        } catch (Exception e) {
-             reportError("Cannot convert '" + inFile + "' to '"
-                         + outFile + "': " + Helpers.reason(e));
+         } catch (IOException e) {
+-            reportError("Cannot convert '" + inFile + "' to '"
+-                        + outFile + "': " + Helpers.reason(e));
++            reportError("Cannot convert '" + inFile + "' to '" + outFile + "': " + Helpers.reason(e));
              return false;
+         }
+     }




More information about the debian-science-commits mailing list