]> git.pld-linux.org Git - packages/libreoffice.git/blame - openoffice-sj2-handle-no-solar-java.patch
- up
[packages/libreoffice.git] / openoffice-sj2-handle-no-solar-java.patch
CommitLineData
43041813 1--- sj2/source/java/jnihelp.cxx.orig 2003-08-08 20:54:39.000000000 -0700
2+++ sj2/source/java/jnihelp.cxx 2003-08-08 20:55:41.000000000 -0700
3@@ -59,6 +59,7 @@
4 *
5 ************************************************************************/
6
7+#ifdef SOLAR_JAVA
8 #include <cstdarg>
9 #include <tools/debug.hxx>
10 #include <jni.h> /* where everything is defined */
11@@ -99,3 +100,5 @@
12 _xJavaThreadRegister_11->revokeThread();
13 }
14 }
15+
16+#endif // SOLAR_JAVA
17--- sj2/source/jscpp/sjapplet.cxx.orig 2003-08-08 20:58:19.000000000 -0700
18+++ sj2/source/jscpp/sjapplet.cxx 2003-08-08 21:01:41.000000000 -0700
19@@ -60,7 +60,9 @@
20 ************************************************************************/
21
22 #include <cstdarg>
23+#ifdef SOLAR_JAVA
24 #include <jnihelp.hxx>
25+#endif // SOLAR_JAVA
26
27 #include <sjapplet.hxx>
28
29@@ -79,11 +81,15 @@
30
31 using namespace ::rtl;
32 using namespace ::utl;
33+#ifdef SOLAR_JAVA
34 using namespace ::sj2;
35+#endif // SOLAR_JAVA
36
37 using namespace ::com::sun::star::lang;
38 using namespace ::com::sun::star::uno;
39+#ifdef SOLAR_JAVA
40 using namespace ::com::sun::star::java;
41+#endif // SOLAR_JAVA
42
43 SjApplet2::SjApplet2()
44 : _pImpl(new SjApplet2_Impl())
45@@ -346,7 +352,7 @@
46 /*
47 * Java init function to invoke Java runtime using JNI invocation API.
48 */
49-
50+#ifdef SOLAR_JAVA
51 void JRE_PropertyChanged( JNIEnv * env, const SvCommandList & rCmdList )
52 {
53 jclass pClass = env->FindClass("java/util/Properties");
54@@ -389,6 +395,7 @@
55 env->DeleteLocalRef( pProps );
56 env->DeleteLocalRef( pClass );
57 }
58+#endif // SOLAR_JAVA
59
60 // Settings are detected by the JavaVM service
61 // This function is not necessary anymore
62--- sj2/source/jscpp/sjapplet_impl.cxx.orig 2003-08-08 21:06:04.000000000 -0700
63+++ sj2/source/jscpp/sjapplet_impl.cxx 2003-08-08 21:24:29.000000000 -0700
64@@ -78,18 +78,24 @@
65 #include <vcl/syschild.hxx>
66 #include <vcl/sysdata.hxx>
67
68+#ifdef SOLAR_JAVA
69 #include <jnihelp.hxx>
70+#endif // SOLAR_JAVA
71
72 using namespace ::rtl;
73 using namespace ::osl;
74+#ifdef SOLAR_JAVA
75 using namespace ::sj2;
76+#endif // SOLAR_JAVA
77 using namespace ::utl;
78
79+#ifdef SOLAR_JAVA
80 using namespace ::com::sun::star::java;
81+#endif // SOLAR_JAVA
82 using namespace ::com::sun::star::lang;
83 using namespace ::com::sun::star::uno;
84
85-
86+#ifdef SOLAR_JAVA
87 static void testJavaException(JNIEnv * pEnv) throw(com::sun::star::uno::RuntimeException)
88 {
89 jthrowable jtThrowable = pEnv->ExceptionOccurred();
90@@ -114,7 +120,14 @@
91 throw RuntimeException(ouMessage, Reference<XInterface>());
92 }
93 }
94+#else // !SOLAR_JAVA
95+static void throwException() throw(com::sun::star::uno::RuntimeException)
96+{
97+ throw RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM("Java applets not supported.")), Reference<XInterface>());
98+}
99+#endif
100
101+#ifdef SOLAR_JAVA
102 #ifdef UNX
103 struct EmbeddedWindow {
104 jobject _joWindow;
105@@ -210,17 +223,22 @@
106
107 _joWindow = 0;
108 }
109+#endif // SOLAR_JAVA
110
111-
112-
113+#ifdef SOLAR_JAVA
114 SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
115 : _pJVM(NULL),
116 _joAppletExecutionContext(0),
117 _jcAppletExecutionContext(0)
118
119 {}
120+#else // !SOLAR_JAVA
121+SjApplet2_Impl::SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException)
122+{}
123+#endif
124
125 SjApplet2_Impl::~SjApplet2_Impl() throw() {
126+#ifdef SOLAR_JAVA
127 if (_joAppletExecutionContext) {
128 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
129
130@@ -230,6 +248,7 @@
131 jenv.pEnv->DeleteGlobalRef(_joAppletExecutionContext);
132 jenv.pEnv->DeleteGlobalRef(_jcAppletExecutionContext);
133 }
134+#endif
135 }
136
137 void SjApplet2_Impl::init(Window * pParentWin,
138@@ -238,6 +257,7 @@
139 const SvCommandList & rCmdList)
140 throw(com::sun::star::uno::RuntimeException)
141 {
142+#ifdef SOLAR_JAVA
143 _pParentWin = pParentWin;
144
145
146@@ -338,11 +358,14 @@
147 joDocBase, joParameters, _pEmbeddedWindow->_joWindow, (jlong)0); testJavaException(jenv.pEnv);
148 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_init); testJavaException(jenv.pEnv);
149 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_startUp); testJavaException(jenv.pEnv);
150-
151+#else // !SOLAR_JAVA
152+ throwException();
153+#endif
154 }
155
156 void SjApplet2_Impl::setSize(const Size & rSize) throw(com::sun::star::uno::RuntimeException)
157 {
158+#ifdef SOLAR_JAVA
159 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
160
161 _pParentWin->SetSizePixel(rSize);
162@@ -350,42 +373,62 @@
163 jmethodID jmAppletExecutionContext_resize = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "appletResize", "(II)V"); testJavaException(jenv.pEnv);
164 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_resize, (jint)rSize.Width(),
165 (jint)rSize.Height()); testJavaException(jenv.pEnv);
166+#else // !SOLAR_JAVA
167+ throwException();
168+#endif
169 }
170
171 void SjApplet2_Impl::restart() throw(com::sun::star::uno::RuntimeException)
172 {
173+#ifdef SOLAR_JAVA
174 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
175
176 jmethodID jmAppletExecutionContext_restart = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "restart", "()V"); testJavaException(jenv.pEnv);
177 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_restart); testJavaException(jenv.pEnv);
178+#else // !SOLAR_JAVA
179+ throwException();
180+#endif
181 }
182
183 void SjApplet2_Impl::reload() throw(com::sun::star::uno::RuntimeException)
184 {
185+#ifdef SOLAR_JAVA
186 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
187
188 jmethodID jmAppletExecutionContext_reload = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "reload", "()V"); testJavaException(jenv.pEnv);
189 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_reload); testJavaException(jenv.pEnv);
190+#else // !SOLAR_JAVA
191+ throwException();
192+#endif
193 }
194
195 void SjApplet2_Impl::start() throw(com::sun::star::uno::RuntimeException)
196 {
197+#ifdef SOLAR_JAVA
198 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
199
200 jmethodID jmAppletExecutionContext_sendStart = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "sendStart", "()V"); testJavaException(jenv.pEnv);
201 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStart); testJavaException(jenv.pEnv);
202+#else // !SOLAR_JAVA
203+ throwException();
204+#endif
205 }
206
207 void SjApplet2_Impl::stop() throw(com::sun::star::uno::RuntimeException)
208 {
209+#ifdef SOLAR_JAVA
210 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
211
212 jmethodID jmAppletExecutionContext_sendStop = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "sendStop", "()V"); testJavaException(jenv.pEnv);
213 jenv.pEnv->CallVoidMethod(_joAppletExecutionContext, jmAppletExecutionContext_sendStop); testJavaException(jenv.pEnv);
214+#else // !SOLAR_JAVA
215+ throwException();
216+#endif
217 }
218
219 void SjApplet2_Impl::close() throw(com::sun::star::uno::RuntimeException)
220 {
221+#ifdef SOLAR_JAVA
222 TKTThreadAttach jenv(_pJVM, _xJavaThreadRegister_11.get());
223
224 jmethodID jmAppletExecutionContext_shutdown = jenv.pEnv->GetMethodID(_jcAppletExecutionContext, "shutdown", "()V"); testJavaException(jenv.pEnv);
225@@ -416,5 +459,8 @@
226 }
227 }
228 }
229+#else // !SOLAR_JAVA
230+ throwException();
231+#endif
232 }
233
234--- sj2/source/jscpp/sjapplet_impl.hxx.orig 2003-08-08 21:24:48.000000000 -0700
235+++ sj2/source/jscpp/sjapplet_impl.hxx 2003-08-08 21:35:45.000000000 -0700
236@@ -1,13 +1,15 @@
237 #include <cstdarg>
238
239-
240+#ifdef SOLAR_JAVA
241 #include <jni.h>
242-
243+#endif // SOLAR_JAVA
244
245 #include <unotools/processfactory.hxx>
246
247+#ifdef SOLAR_JAVA
248 #include <com/sun/star/java/XJavaVM.hpp>
249 #include <com/sun/star/java/XJavaThreadRegister_11.hpp>
250+#endif // SOLAR_JAVA
251
252 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
253
254@@ -16,9 +18,12 @@
255 class SvCommandList;
256 class Size;
257
258+#ifdef SOLAR_JAVA
259 struct EmbeddedWindow;
260+#endif // SOLAR_JAVA
261
262 struct SjApplet2_Impl {
263+#ifdef SOLAR_JAVA
264 Window * _pParentWin;
265
266 JavaVM * _pJVM;
267@@ -29,6 +34,7 @@
268
269 com::sun::star::uno::Reference<com::sun::star::java::XJavaVM> _xJavaVM;
270 com::sun::star::uno::Reference<com::sun::star::java::XJavaThreadRegister_11> _xJavaThreadRegister_11;
271+#endif // SOLAR_JAVA
272
273 SjApplet2_Impl() throw(com::sun::star::uno::RuntimeException);
274 ~SjApplet2_Impl() throw();
This page took 0.207261 seconds and 4 git commands to generate.