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

Stephan Bergmann sbergman at redhat.com
Tue Nov 17 01:31:30 PST 2015


 connectivity/source/drivers/hsqldb/HStorageMap.cxx   |    3 ++-
 connectivity/source/drivers/jdbc/tools.cxx           |    5 +++--
 connectivity/source/drivers/macab/macabutilities.hxx |    4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit de3fd5d5378c95504d9c1ef1bedad8746921d2a6
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 17 10:31:05 2015 +0100

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

diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index c9b8992..4025aba 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -147,7 +147,8 @@ namespace connectivity
                 jboolean bCopy(sal_True);
                 const jchar* pChar = env->GetStringChars(jstr,&bCopy);
                 jsize len = env->GetStringLength(jstr);
-                aStr = OUString(pChar,len);
+                aStr = OUString(
+                    reinterpret_cast<sal_Unicode const *>(pChar), len);
 
                 if(bCopy)
                     env->ReleaseStringChars(jstr,pChar);
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
index a2e0a29..9d679dd 100644
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ b/connectivity/source/drivers/jdbc/tools.cxx
@@ -95,7 +95,8 @@ java_util_Properties::java_util_Properties( ): java_lang_Object( nullptr, nullpt
 jstring connectivity::convertwchar_tToJavaString(JNIEnv *pEnv,const OUString& _rTemp)
 {
     OSL_ENSURE(pEnv,"Environment is NULL!");
-    jstring pStr = pEnv->NewString(_rTemp.getStr(), _rTemp.getLength());
+    jstring pStr = pEnv->NewString(
+        reinterpret_cast<jchar const *>(_rTemp.getStr()), _rTemp.getLength());
     pEnv->ExceptionClear();
     OSL_ENSURE(pStr,"Could not create a jsstring object!");
     return pStr;
@@ -163,7 +164,7 @@ OUString connectivity::JavaString2String(JNIEnv *pEnv,jstring _Str)
         jboolean bCopy(sal_True);
         const jchar* pChar = pEnv->GetStringChars(_Str,&bCopy);
         jsize len = pEnv->GetStringLength(_Str);
-        aStr = OUString(pChar,len);
+        aStr = OUString(reinterpret_cast<sal_Unicode const *>(pChar), len);
 
         if(bCopy)
             pEnv->ReleaseStringChars(_Str,pChar);
diff --git a/connectivity/source/drivers/macab/macabutilities.hxx b/connectivity/source/drivers/macab/macabutilities.hxx
index c1b9880..4add209 100644
--- a/connectivity/source/drivers/macab/macabutilities.hxx
+++ b/connectivity/source/drivers/macab/macabutilities.hxx
@@ -57,7 +57,7 @@ namespace connectivity
             CFStringGetCharacters (sOrig, CFRangeMake(0,nStringLength), unichars);
             CFRelease(sOrig);
 
-            return OUString(unichars);
+            return OUString(reinterpret_cast<sal_Unicode *>(unichars));
         }
 
 
@@ -68,7 +68,7 @@ namespace connectivity
              * File was: fpicker/source/aqua/CFStringUtilities
              */
 
-            CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, aString.getStr(), aString.getLength());
+            CFStringRef ref = CFStringCreateWithCharacters(kCFAllocatorDefault, reinterpret_cast<UniChar const *>(aString.getStr()), aString.getLength());
 
             return ref;
         }


More information about the Libreoffice-commits mailing list