[Libreoffice-commits] core.git: javaunohelper/source

Stephan Bergmann sbergman at redhat.com
Tue Nov 17 01:39:10 PST 2015


 javaunohelper/source/bootstrap.cxx     |    2 +-
 javaunohelper/source/javaunohelper.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 6a8a84c72f89930094870df1ed2a65bfe5768a44
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 17 10:38:44 2015 +0100

    Don't assume sal_Unicode is unsigned short
    
    Change-Id: I083a33e71d1bb9fcef3b287e1db15910779312ab

diff --git a/javaunohelper/source/bootstrap.cxx b/javaunohelper/source/bootstrap.cxx
index ac3b596..e245ecc 100644
--- a/javaunohelper/source/bootstrap.cxx
+++ b/javaunohelper/source/bootstrap.cxx
@@ -53,7 +53,7 @@ inline OUString jstring_to_oustring( jstring jstr, JNIEnv * jni_env )
     jsize len = jni_env->GetStringLength( jstr );
     rtl_uString * ustr =
         static_cast<rtl_uString *>(rtl_allocateMemory( sizeof (rtl_uString) + (len * sizeof (sal_Unicode)) ));
-    jni_env->GetStringRegion( jstr, 0, len, ustr->buffer );
+    jni_env->GetStringRegion( jstr, 0, len, reinterpret_cast<jchar *>(ustr->buffer) );
     OSL_ASSERT( !jni_env->ExceptionCheck() );
     ustr->refCount = 1;
     ustr->length = len;
diff --git a/javaunohelper/source/javaunohelper.cxx b/javaunohelper/source/javaunohelper.cxx
index 83c9643..d18979b 100644
--- a/javaunohelper/source/javaunohelper.cxx
+++ b/javaunohelper/source/javaunohelper.cxx
@@ -56,7 +56,7 @@ jboolean Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1writeInfo(
     bool bRet = false;
 
     const jchar* pJLibName = pJEnv->GetStringChars(jLibName, nullptr);
-    OUString aLibName(pJLibName);
+    OUString aLibName(reinterpret_cast<sal_Unicode const *>(pJLibName));
     pJEnv->ReleaseStringChars(jLibName, pJLibName);
 
 #ifdef DISABLE_DYNLOADING
@@ -138,7 +138,7 @@ jobject Java_com_sun_star_comp_helper_SharedLibraryLoader_component_1getFactory(
     jobject jSMgr, jobject jRegKey, jobject loader )
 {
     const jchar* pJLibName = pJEnv->GetStringChars(jLibName, nullptr);
-    OUString aLibName(pJLibName);
+    OUString aLibName(reinterpret_cast<sal_Unicode const *>(pJLibName));
     pJEnv->ReleaseStringChars(jLibName, pJLibName);
 
 #ifdef DISABLE_DYNLOADING


More information about the Libreoffice-commits mailing list