diff options
author | obo <obo@openoffice.org> | 2010-10-28 10:51:46 +0200 |
---|---|---|
committer | obo <obo@openoffice.org> | 2010-10-28 10:51:46 +0200 |
commit | 087651450c6aa121ea0f1830e7d8224c79588e41 (patch) | |
tree | 597d17ed40fb2027937498208a04ae3e53cb4ced /jvmfwk/source/framework.cxx | |
parent | 5c04ffa2a50e3d61cc9beae038e9069713cdefca (diff) | |
parent | 3352853a9d6779a40a50ce7ecee6d794a6a5075f (diff) |
CWS-TOOLING: integrate CWS jl162
Notes
Notes:
split repo tag: ure_ooo/OOO330_m13
split repo tag: ure_ooo/OOO330_m14
split repo tag: ure_ooo/OOO330_m15
Diffstat (limited to 'jvmfwk/source/framework.cxx')
-rw-r--r-- | jvmfwk/source/framework.cxx | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 1a2ac3b954ef..1194e73402dd 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -1114,29 +1114,39 @@ javaFrameworkError SAL_CALL jfw_getJRELocations( javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist) { - javaFrameworkError ret = JFW_E_NONE; - if (!pInfo || !exist) - return JFW_E_INVALID_ARG; - ::rtl::OUString sLocation(pInfo->sLocation); - - if (sLocation.getLength() == 0) - return JFW_E_INVALID_ARG; + //get the function jfw_plugin_existJRE + jfw::VendorSettings aVendorSettings; + jfw::CJavaInfo aInfo; + aInfo = (const ::JavaInfo*) pInfo; //makes a copy of pInfo + rtl::OUString sLibPath = aVendorSettings.getPluginLibrary(aInfo.getVendor()); + osl::Module modulePlugin(sLibPath); + if ( ! modulePlugin) + return JFW_E_NO_PLUGIN; + rtl::OUString sFunctionName( + RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_existJRE")); + jfw_plugin_existJRE_ptr pFunc = + (jfw_plugin_existJRE_ptr) + osl_getFunctionSymbol(modulePlugin, sFunctionName.pData); + if (pFunc == NULL) + return JFW_E_ERROR; + + javaPluginError plerr = (*pFunc)(pInfo, exist); - ::osl::DirectoryItem item; - ::osl::File::RC rc_item = ::osl::DirectoryItem::get(sLocation, item); - if (::osl::File::E_None == rc_item) - { - *exist = sal_True; - } - else if (::osl::File::E_NOENT == rc_item) - { - *exist = sal_False; - } - else + javaFrameworkError ret = JFW_E_NONE; + switch (plerr) { + case JFW_PLUGIN_E_NONE: + ret = JFW_E_NONE; + break; + case JFW_PLUGIN_E_INVALID_ARG: + ret = JFW_E_INVALID_ARG; + break; + case JFW_PLUGIN_E_ERROR: + ret = JFW_E_ERROR; + break; + default: ret = JFW_E_ERROR; } - return ret; } |