[Libreoffice-commits] .: 4 commits - bridges/source cppu/inc cppu/source javaunohelper/com

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 21 04:48:24 PDT 2012


 bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java |   19 ++++++++
 bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java       |   23 +++++++++-
 bridges/source/jni_uno/jni_bridge.cxx                                         |    4 +
 cppu/inc/uno/mapping.h                                                        |   10 ++++
 cppu/source/uno/lbmap.cxx                                                     |   15 ++++--
 javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java            |   19 +++++++-
 javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java               |   19 +++++++-
 7 files changed, 100 insertions(+), 9 deletions(-)

New commits:
commit 79f94fee9ea3c223ddd4035916a0fb4f1a123fb3
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Sep 21 14:33:25 2012 +0300

    There is no java_uno library to load in the disable-dynloading case on Android
    
    Change-Id: I350aeeb7fb1e00b201077883dd5fd601b42a626b

diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
index bdde4f8..4285ecc 100644
--- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
+++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java
@@ -1,3 +1,4 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 /*
  * This file is part of the LibreOffice project.
  *
@@ -24,6 +25,22 @@ import com.sun.star.lib.util.NativeLibraryLoader;
 public final class JNI_info_holder
 {
     static {
+        if (System.getProperty("java.vendor") == "The Android Project") {
+            // See corresponding code in
+            // javaunohelper/com/sun/star/comp/helper/Bootstrap.java for more
+            // comments.
+
+            boolean disable_dynloading = false;
+            try {
+                System.loadLibrary("lo-bootstrap");
+            } catch (UnsatisfiedLinkError e) {
+                disable_dynloading = true;
+            }
+
+            if (!disable_dynloading)
+                NativeLibraryLoader.loadLibrary(JNI_info_holder.class.getClassLoader(),
+                                                "java_uno");
+    } else
         NativeLibraryLoader.loadLibrary(JNI_info_holder.class.getClassLoader(),
                                         "java_uno");
     }
@@ -41,3 +58,5 @@ public final class JNI_info_holder
         finalize( s_jni_info_handle );
     }
 }
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
index 0b19ba6..31861d6 100644
--- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
+++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java
@@ -1,3 +1,4 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 /*
  * This file is part of the LibreOffice project.
  *
@@ -30,8 +31,24 @@ import com.sun.star.uno.IQueryInterface;
 public final class JNI_proxy implements java.lang.reflect.InvocationHandler
 {
     static {
-        NativeLibraryLoader.loadLibrary(JNI_proxy.class.getClassLoader(),
-                                        "java_uno");
+        if (System.getProperty("java.vendor") == "The Android Project") {
+            // See corresponding code in
+            // javaunohelper/com/sun/star/comp/helper/Bootstrap.java for more
+            // comments.
+
+            boolean disable_dynloading = false;
+            try {
+                System.loadLibrary("lo-bootstrap");
+            } catch (UnsatisfiedLinkError e) {
+                disable_dynloading = true;
+            }
+
+            if (!disable_dynloading)
+                NativeLibraryLoader.loadLibrary(JNI_info_holder.class.getClassLoader(),
+                                                "java_uno");
+        } else
+            NativeLibraryLoader.loadLibrary(JNI_proxy.class.getClassLoader(),
+                                            "java_uno");
     }
     protected static ClassLoader s_classloader =
         JNI_proxy.class.getClassLoader();
@@ -204,3 +221,5 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler
                            && m_oid.equals(UnoRuntime.generateOid(obj)));
     }
 }
+
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
commit f09f52e4add4999264bbf960a3a7af6a6b7a8285
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Sep 21 14:29:16 2012 +0300

    Need also uno_ext_getMapping for Java when DISABLE_DYNLOADING
    
    Change-Id: I65f09e54c80df4e96e24548692eeb3a57e1de517

diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
index f8fdbce..f9cfffc 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -474,6 +474,10 @@ void SAL_CALL uno_initEnvironment( uno_Environment * java_env )
     machine->acquire();
 }
 
+#ifdef DISABLE_DYNLOADING
+#define uno_ext_getMapping java_uno_ext_getMapping
+#endif
+
 //------------------------------------------------------------------------------
 void SAL_CALL uno_ext_getMapping(
     uno_Mapping ** ppMapping, uno_Environment * pFrom, uno_Environment * pTo )
diff --git a/cppu/inc/uno/mapping.h b/cppu/inc/uno/mapping.h
index 7d02179..1f3828a 100644
--- a/cppu/inc/uno/mapping.h
+++ b/cppu/inc/uno/mapping.h
@@ -193,6 +193,16 @@ void SAL_CALL CPPU_ENV_uno_ext_getMapping(
     struct _uno_Environment * pFrom,
     struct _uno_Environment * pTo )
     SAL_THROW_EXTERN_C();
+
+#ifdef SOLAR_JAVA
+/* This is the uno_ext_getMapping function in the Java/UNO bridge */
+void SAL_CALL java_uno_ext_getMapping(
+    struct _uno_Mapping ** ppMapping,
+    struct _uno_Environment * pFrom,
+    struct _uno_Environment * pTo )
+    SAL_THROW_EXTERN_C();
+#endif
+
 #endif
 
 #ifdef __cplusplus
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 2720811..e6892d4 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -329,6 +329,11 @@ static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
 {
     if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
         return CPPU_ENV_uno_ext_getMapping;
+#ifdef SOLAR_JAVA
+    if (rBridgeName.equalsAscii( "java" "_uno" ))
+        return java_uno_ext_getMapping;
+#endif
+
 #if 0
     // I don't think the affine or log bridges will be needed on any
     // DISABLE_DYNLOADING platform (iOS at least, possibly Android), but if
commit e5045bea0ab261e47c2829d33cd8e383dfb8e684
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Sep 14 15:01:30 2012 +0300

    Adapt for DISABLE_DYNLOADING possibility also for Android
    
    Change-Id: Ie1ff96b6f58bf694b8d08a3316144becaaefe6d9

diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index 25d38b6..2720811 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -329,11 +329,11 @@ static uno_ext_getMappingFunc selectMapFunc( const OUString & rBridgeName )
 {
     if (rBridgeName.equalsAscii( CPPU_CURRENT_LANGUAGE_BINDING_NAME "_uno" ))
         return CPPU_ENV_uno_ext_getMapping;
-#ifndef IOS
-    // I don't think the affine or log bridges will be needed on iOS,
-    // and DISABLE_DYNLOADING will hardly be used elsewhere, but if
-    // somebody wants to experiment, need to find out then whether
-    // these are needed.
+#if 0
+    // I don't think the affine or log bridges will be needed on any
+    // DISABLE_DYNLOADING platform (iOS at least, possibly Android), but if
+    // somebody wants to experiment, need to find out then whether these are
+    // needed.
     if (rBridgeName.equalsAscii( "affine_uno_uno" ))
         return affine_uno_uno_ext_getMapping;
     if (rBridgeName.equalsAscii( "log_uno_uno" ))
commit 41e8c36d09c865f21feb465337e56e3e524c9e29
Author: Tor Lillqvist <tml at iki.fi>
Date:   Fri Sep 21 14:23:24 2012 +0300

    No juh library to load in the disable-dynloading case (on Android)
    
    Change-Id: I6a5eefe86e23499b555b34c6ba2ebe131e109304

diff --git a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java
index 44fcb4a..8f0bc29 100644
--- a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java
+++ b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java
@@ -1,3 +1,4 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 /*
  * This file is part of the LibreOffice project.
  *
@@ -31,7 +32,22 @@ import com.sun.star.uno.RuntimeException;
 */
 public class RegistryServiceFactory {
     static {
-        System.loadLibrary("juh");
+        if (System.getProperty("java.vendor") == "The Android Project") {
+            // See corresponding code in
+            // javaunohelper/com/sun/star/comp/helper/Bootstrap.java for more
+            // comments.
+
+            boolean disable_dynloading = false;
+            try {
+                System.loadLibrary("lo-bootstrap");
+            } catch (UnsatisfiedLinkError e) {
+                disable_dynloading = true;
+            }
+
+            if (!disable_dynloading)
+                System.loadLibrary("juh");
+        } else
+            System.loadLibrary("juh");
     }
 
     private static native Object createRegistryServiceFactory(
@@ -157,3 +173,4 @@ public class RegistryServiceFactory {
     }
 }
 
+// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java
index c5918e6..a9cfe46 100644
--- a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java
+++ b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java
@@ -1,3 +1,4 @@
+// -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 /*
  * This file is part of the LibreOffice project.
  *
@@ -45,7 +46,22 @@ public class SharedLibraryLoader {
     public static final String DEFAULT_IMPLEMENTATION = "com.sun.star.comp.stoc.DLLComponentLoader";
 
     static {
-        System.loadLibrary("juh");
+        if (System.getProperty("java.vendor") == "The Android Project") {
+            // See corresponding code in
+            // javaunohelper/com/sun/star/comp/helper/Bootstrap.java for more
+            // comments.
+
+            boolean disable_dynloading = false;
+            try {
+                System.loadLibrary("lo-bootstrap");
+            } catch (UnsatisfiedLinkError e) {
+                disable_dynloading = true;
+            }
+
+            if (!disable_dynloading)
+                System.loadLibrary("juh");
+        } else
+            System.loadLibrary("juh");
     }
 
     private static native boolean component_writeInfo(
@@ -148,3 +164,4 @@ public class SharedLibraryLoader {
     }
 }
 
+// vim:set shiftwidth=4 softtabstop=4 expandtab:


More information about the Libreoffice-commits mailing list