Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / external / languagetool / JLanguageTool-1.7.0.patch
blob782b683af79ef23a955429528721f8d9adc4742d
1 diff -Naur misc/build/JLanguageTool-1.7.0/build.xml misc/build/JLanguageTool-1.7.0_patched/build.xml
2 --- misc/build/JLanguageTool-1.7.0/build.xml 2012-06-25 08:22:35.000000000 +0200
3 +++ misc/build/JLanguageTool-1.7.0_patched/build.xml 2012-06-25 09:27:39.077442000 +0200
4 @@ -29,7 +29,9 @@
5 <pathelement location="${ext.CJFtransform.lib}" />
6 <pathelement location="${ext.commons-validator.lib}" />
7 <!-- -->
8 - <pathelement location="${ext.ooo.juh.lib}" />
9 + <pathelement location="${ext.junit.lib}"/>
10 + <!-- -->
11 + <pathelement location="${ext.ooo.juh.lib}" />
12 <pathelement location="${ext.ooo.unoil.lib}" />
13 <pathelement location="${ext.ooo.ridl.lib}" />
14 <pathelement location="${ext.ooo.jurt.lib}" />
15 @@ -442,11 +444,11 @@
16 <!-- ================================================================== -->
18 <target name="dist" depends="ooo-internal" description="Builds one ZIP for both OpenOffice.org and stand-alone use">
19 -<zip compress="yes" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
20 +<zip compress="yes" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
21 </target>
23 <target name="fast" depends="ooo-internal" description="like dist, but without ZIP compression (for development only)">
24 -<zip compress="no" destfile="${dist.dir}/LanguageTool-${version}.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
25 +<zip compress="no" destfile="${dist.dir}/LanguageTool.oxt" basedir="${dist.dir}" includes="**" excludes="deploy.sh,undeploy.sh,turn.sh,printlocales.jar" />
26 </target>
28 <target name="common" depends="clean,init,build,ooo-build">
29 @@ -651,7 +653,6 @@
30 <copy file="${resource.dir}/ast/asturian.dict" todir="${dist.dir}/resource/ast" />
31 <copy file="${resource.dir}/ast/asturian.info" todir="${dist.dir}/resource/ast" />
33 - <copy file="${resource.dir}/xx/dummy.dict" tofile="${dist.dir}/resource/cs/czech.dict" />
34 <copy todir="${dist.dir}/rules">
35 <fileset dir="src/rules" excludes="CVS" />
36 </copy>
37 @@ -678,7 +678,7 @@
39 <filter filtersFile="ooolocales.properties" />
40 <copy filtering="true" encoding="${encoding}" todir="${dist.dir}/">
41 - <fileset dir="openoffice/" includes="description.xml,*.xcu,Options.xdl,META-INF/**" />
42 + <fileset dir="openoffice/" includes="components.rdb,description.xml,*.xcu,Options.xdl,META-INF/**" />
43 </copy>
44 <copy todir="${dist.dir}/">
45 <fileset dir="openoffice/" includes="images/**,help/**" />
46 diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/components.rdb misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb
47 --- misc/build/JLanguageTool-1.7.0/openoffice/components.rdb 1970-01-01 01:00:00.000000000 +0100
48 +++ misc/build/JLanguageTool-1.7.0_patched/openoffice/components.rdb 2012-06-25 10:26:23.183633100 +0200
49 @@ -0,0 +1,9 @@
50 +<?xml version="1.0"?>
51 +<components xmlns="http://openoffice.org/2010/uno-components">
52 + <component loader="com.sun.star.loader.Java2" uri="./LanguageTool.uno.jar">
53 + <implementation name="org.languagetool.openoffice.Main">
54 + <service name="com.sun.star.linguistic2.Proofreader"/>
55 + <service name="org.languagetool.openoffice.Main"/>
56 + </implementation>
57 + </component>
58 +</components>
59 diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml
60 --- misc/build/JLanguageTool-1.7.0/openoffice/META-INF/manifest.xml 2012-06-25 08:22:34.000000000 +0200
61 +++ misc/build/JLanguageTool-1.7.0_patched/openoffice/META-INF/manifest.xml 2012-06-25 09:39:56.751738000 +0200
62 @@ -2,8 +2,8 @@
63 <manifest:manifest>
64 <manifest:file-entry manifest:full-path="Addons.xcu"
65 manifest:media-type="application/vnd.sun.star.configuration-data" />
66 - <manifest:file-entry manifest:full-path="LanguageTool.uno.jar"
67 - manifest:media-type="application/vnd.sun.star.uno-component;type=Java" />
68 + <manifest:file-entry manifest:full-path="components.rdb"
69 + manifest:media-type="application/vnd.sun.star.uno-components" />
70 <manifest:file-entry
71 manifest:media-type="application/vnd.sun.star.configuration-data"
72 manifest:full-path="Linguistic.xcu" />
73 diff -Naur misc/build/JLanguageTool-1.7.0/openoffice/description.xml misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml
74 --- misc/build/JLanguageTool-1.7.0/openoffice/description.xml 2012-06-25 08:22:35.000000000 +0200
75 +++ misc/build/JLanguageTool-1.7.0_patched/openoffice/description.xml 2012-06-25 10:29:48.520591800 +0200
76 @@ -21,7 +21,7 @@
77 <name lang="zh">LanguageTool. 开源的语言检查工具</name>
78 <name lang="br">LanguageTool. Reizher reizhskrivadurel frank.</name>
79 </display-name>
80 - <version value="@version@" />
81 + <version value="1.7.1" />
82 <release-notes>
83 <src xlink:href="CHANGES.txt" lang="en" />
84 </release-notes>
85 diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java
86 --- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/gui/Configuration.java 2012-06-25 08:21:31.000000000 +0200
87 +++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/gui/Configuration.java 2012-06-25 09:31:40.737466400 +0200
88 @@ -23,6 +23,7 @@
89 import java.io.FileNotFoundException;
90 import java.io.FileOutputStream;
91 import java.io.IOException;
92 +import java.lang.ClassLoader;
93 import java.util.*;
95 import org.languagetool.Language;
96 @@ -142,7 +143,18 @@
98 final String motherTongueStr = (String) props.get(MOTHER_TONGUE_CONFIG_KEY);
99 if (motherTongueStr != null) {
100 - motherTongue = Language.getLanguageForShortName(motherTongueStr);
101 + // FIXME: hack to disable the functionality for JRE 1.5
102 + // javax.xml.bind.JAXBException is part of JRE 1.6
103 + boolean isJRE15 = false;
104 + try {
105 + ClassLoader cl = ClassLoader.getSystemClassLoader();
106 + cl.loadClass("javax.xml.bind.JAXBException");
107 + } catch (ClassNotFoundException e) {
108 + isJRE15 = true;
110 + if (!isJRE15) {
111 + motherTongue = Language.getLanguageForShortName(motherTongueStr);
115 final String autoDetectStr = (String) props.get(AUTO_DETECT_CONFIG_KEY);
116 diff -Naur misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java
117 --- misc/build/JLanguageTool-1.7.0/src/java/org/languagetool/openoffice/Main.java 2012-06-25 08:21:28.000000000 +0200
118 +++ misc/build/JLanguageTool-1.7.0_patched/src/java/org/languagetool/openoffice/Main.java 2012-06-25 09:36:03.778528700 +0200
119 @@ -24,6 +24,7 @@
120 * @author Marcin Miłkowski
122 import java.io.File;
123 +import java.lang.ClassLoader;
124 import java.util.ArrayList;
125 import java.util.Arrays;
126 import java.util.Comparator;
127 @@ -494,6 +495,14 @@
129 @Override
130 public final Locale[] getLocales() {
131 + // FIXME: hack to disable the functionality for JRE 1.5
132 + // javax.xml.bind.JAXBException is part of JRE 1.6
133 + try {
134 + ClassLoader cl = ClassLoader.getSystemClassLoader();
135 + cl.loadClass("javax.xml.bind.JAXBException");
136 + } catch (ClassNotFoundException e) {
137 + return new Locale[0];
139 try {
140 int dims = 0;
141 for (final Language element : Language.LANGUAGES) {