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

Stephan Bergmann sbergman at redhat.com
Thu Feb 25 09:39:05 UTC 2016


 connectivity/source/commontools/CommonTools.cxx |   19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

New commits:
commit f66d734bcd994cb5fc2f38a8d9018e13385cd10c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Feb 25 10:37:10 2016 +0100

    The XJavaVM.getJavaVM return value can always be extracted to sal_Int64
    
    (avoids warning with MSVC 2015)
    
    Change-Id: I9b3c5bc26a1e3df88a03e5fb295eb6a8fb63f824

diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 8a0f25b..edc40bb 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -129,23 +129,12 @@ namespace connectivity
             processID[16] = 0;
 
             Any uaJVM = xVM->getJavaVM( processID );
-
-            if (!uaJVM.hasValue())
+            sal_Int64 nTemp;
+            if (!(uaJVM >>= nTemp)) {
                 throw Exception(); // -5
-            else
-            {
-                sal_Int32 nValue = 0;
-                jvmaccess::VirtualMachine* pJVM = nullptr;
-                if ( uaJVM >>= nValue )
-                    pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nValue);
-                else
-                {
-                    sal_Int64 nTemp = 0;
-                    uaJVM >>= nTemp;
-                    pJVM = reinterpret_cast< jvmaccess::VirtualMachine* > (nTemp);
-                }
-                aRet = pJVM;
             }
+            aRet = reinterpret_cast<jvmaccess::VirtualMachine *>(
+                static_cast<sal_IntPtr>(nTemp));
         }
         catch (Exception&)
         {


More information about the Libreoffice-commits mailing list