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