From 0bde7de8c3bcf9551ea1788d56e56437178ac437 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Wed, 29 Jan 2020 08:20:15 +0100 Subject: [PATCH] Removed latex/bibtex code --- .../da/comp/w2lcommon/filter/UNOConverter.java | 4 ++-- src/main/java/writer2latex/Application.java | 17 +++++++---------- .../java/writer2latex/api/ConverterFactory.java | 7 +++---- src/main/java/writer2latex/api/MIMETypes.java | 4 ++-- .../java/writer2latex/office/MIMETypes.java | 4 ++-- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/openoffice/da/comp/w2lcommon/filter/UNOConverter.java b/src/main/java/org/openoffice/da/comp/w2lcommon/filter/UNOConverter.java index 656a95c..deb90c1 100644 --- a/src/main/java/org/openoffice/da/comp/w2lcommon/filter/UNOConverter.java +++ b/src/main/java/org/openoffice/da/comp/w2lcommon/filter/UNOConverter.java @@ -72,8 +72,8 @@ public class UNOConverter { // Create mapping from filter names to target media types HashMap filterNames = new HashMap(); - filterNames.put("org.openoffice.da.writer2latex","application/x-latex"); - filterNames.put("org.openoffice.da.writer2bibtex","application/x-bibtex"); + //filterNames.put("org.openoffice.da.writer2latex","application/x-latex"); + //filterNames.put("org.openoffice.da.writer2bibtex","application/x-bibtex"); filterNames.put("org.openoffice.da.writer2xhtml","text/html"); filterNames.put("org.openoffice.da.writer2xhtml11","application/xhtml11"); filterNames.put("org.openoffice.da.writer2xhtml5","text/html5"); diff --git a/src/main/java/writer2latex/Application.java b/src/main/java/writer2latex/Application.java index 3e0d849..cdebd4d 100644 --- a/src/main/java/writer2latex/Application.java +++ b/src/main/java/writer2latex/Application.java @@ -52,7 +52,7 @@ import writer2latex.util.Misc; *
java -jar writer2latex.jar [options] source [target]
*

Where the available options are *

    - *
  • -latex, -bibtex, -html5, -xhtml, + *
  • -html5, -xhtml, -xhtml+mathml, -epub, -epub3 *
  • -recurse *
  • -ultraclean, -clean, -pdfscreen, @@ -69,7 +69,7 @@ import writer2latex.util.Misc; public final class Application { /* Based on command-line parameters. */ - private String sTargetMIME = MIMETypes.LATEX; + private String sTargetMIME = MIMETypes.HTML5; private boolean bRecurse = false; private Vector configFileNames = new Vector(); private String sTemplateFileName = null; @@ -101,9 +101,10 @@ public final class Application { private void doConversion() { // Step 1: Say hello... String sOutputFormat; - if (MIMETypes.LATEX.equals(sTargetMIME)) { sOutputFormat = "LaTeX"; } - else if (MIMETypes.BIBTEX.equals(sTargetMIME)) { sOutputFormat = "BibTeX"; } - else { sOutputFormat = "xhtml"; } + //if (MIMETypes.LATEX.equals(sTargetMIME)) { sOutputFormat = "LaTeX"; } + //else if (MIMETypes.BIBTEX.equals(sTargetMIME)) { sOutputFormat = "BibTeX"; } + //else { sOutputFormat = "xhtml"; } + sOutputFormat = "xhtml"; System.out.println(); System.out.println("This is Writer2" + sOutputFormat + ", Version " + ConverterFactory.getVersion() + @@ -322,8 +323,6 @@ public final class Application { System.out.println("Usage:"); System.out.println(" java -jar /writer2latex.jar []"); System.out.println("where the available options are:"); - System.out.println(" -latex"); - System.out.println(" -bibtex"); System.out.println(" -xhtml"); System.out.println(" -xhtml11"); System.out.println(" -xhtml+mathml"); @@ -359,9 +358,7 @@ public final class Application { while (i *

    Currently supported MIME types are:

    *
      - *
    • application/x-latex for LaTeX format
    • - *
    • application/x-bibtex for BibTeX format
    • *
    • text/html for XHTML 1.0 strict format
    • *
    • application/xhtml11 for XHTML 1.1 format * Note that this is not the recommended media type for XHTML 1.1 @@ -72,13 +70,14 @@ public class ConverterFactory { */ public static Converter createConverter(String sMIME) { Object converter = null; - if (MIMETypes.LATEX.equals(sMIME)) { + /*if (MIMETypes.LATEX.equals(sMIME)) { converter = createInstance("writer2latex.latex.ConverterPalette"); } else if (MIMETypes.BIBTEX.equals(sMIME)) { converter = createInstance("writer2latex.bibtex.Converter"); } - else if (MIMETypes.XHTML.equals(sMIME)) { + else*/ + if (MIMETypes.XHTML.equals(sMIME)) { converter = createInstance("writer2latex.xhtml.Xhtml10Converter"); } else if (MIMETypes.XHTML11.equals(sMIME)) { diff --git a/src/main/java/writer2latex/api/MIMETypes.java b/src/main/java/writer2latex/api/MIMETypes.java index 86f1473..35d0628 100644 --- a/src/main/java/writer2latex/api/MIMETypes.java +++ b/src/main/java/writer2latex/api/MIMETypes.java @@ -55,8 +55,8 @@ public class MIMETypes { public static final String EPUB="application/epub+zip"; /** This is not a MIME type either */ public static final String EPUB3="epub3"; - public static final String LATEX="application/x-latex"; - public static final String BIBTEX="application/x-bibtex"; + //public static final String LATEX="application/x-latex"; + //public static final String BIBTEX="application/x-bibtex"; public static final String TEXT="text"; } \ No newline at end of file diff --git a/src/main/java/writer2latex/office/MIMETypes.java b/src/main/java/writer2latex/office/MIMETypes.java index 79cd93d..26c8ebb 100644 --- a/src/main/java/writer2latex/office/MIMETypes.java +++ b/src/main/java/writer2latex/office/MIMETypes.java @@ -137,8 +137,8 @@ public final class MIMETypes extends writer2latex.api.MIMETypes { if (SVG.equals(sMIME)) { return SVG_EXT; } if (SVM.equals(sMIME)) { return SVM_EXT; } if (PDF.equals(sMIME)) { return PDF_EXT; } - if (LATEX.equals(sMIME)) { return LATEX_EXT; } - if (BIBTEX.equals(sMIME)) { return BIBTEX_EXT; } + /*if (LATEX.equals(sMIME)) { return LATEX_EXT; } + if (BIBTEX.equals(sMIME)) { return BIBTEX_EXT; }*/ if (XHTML.equals(sMIME)) { return XHTML_EXT; } if (XHTML_MATHML.equals(sMIME)) { return XHTML_MATHML_EXT; } if (HTML5.equals(sMIME)) { return XHTML_EXT; }