summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2004-05-12 09:33:33 +0000
committerJoachim Lingner <jl@openoffice.org>2004-05-12 09:33:33 +0000
commit54308967168c3a07bb811296e234c2897f08a195 (patch)
tree6a4485ed26bf0d8f906dafff1cac0013e7c04126 /jvmfwk
parent5abe67d7e1f4a924a2e0626cd9117c172fe8ee32 (diff)
#i20052#
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/source/framework.cxx27
1 files changed, 18 insertions, 9 deletions
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 31e7f5e9406c..f097ee82fca2 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: framework.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: jl $ $Date: 2004-05-10 14:34:20 $
+ * last change: $Author: jl $ $Date: 2004-05-12 10:33:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -651,10 +651,10 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
sal_Bool SAL_CALL jfw_areEqualJavaInfo(
JavaInfo const * pInfoA,JavaInfo const * pInfoB)
{
- OSL_ASSERT(pInfoA != NULL && pInfoB != NULL);
if (pInfoA == pInfoB)
return sal_True;
-
+ if (pInfoA == NULL || pInfoB == NULL)
+ return sal_False;
rtl::OUString sVendor(pInfoA->sVendor);
rtl::OUString sLocation(pInfoA->sLocation);
rtl::OUString sVersion(pInfoA->sVersion);
@@ -814,13 +814,22 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo)
{
osl::MutexGuard guard(jfw::getFwkMutex());
javaFrameworkError errcode = JFW_E_NONE;
- jfw::CNodeJava node;
- node.setJavaInfo(pInfo);
- errcode = node.writeSettings();
+ //check if pInfo is the selected JRE
+ JavaInfo *currentInfo = NULL;
+ errcode = jfw_getSelectedJRE( & currentInfo);
if (errcode != JFW_E_NONE)
return errcode;
- //remember that the JRE was selected in this process
- jfw::setJavaSelected();
+
+ if (jfw_areEqualJavaInfo(currentInfo, pInfo) == sal_False)
+ {
+ jfw::CNodeJava node;
+ node.setJavaInfo(pInfo);
+ errcode = node.writeSettings();
+ if (errcode != JFW_E_NONE)
+ return errcode;
+ //remember that the JRE was selected in this process
+ jfw::setJavaSelected();
+ }
return errcode;
}
javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)