diff options
author | Joachim Lingner <jl@openoffice.org> | 2004-05-14 13:44:10 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2004-05-14 13:44:10 +0000 |
commit | 4078f3b82ff4035f17257e965ed56178ffcff983 (patch) | |
tree | 43e6c0a9089eb079bb0a7f287535aaf1ae1ae6a3 /jvmfwk/source/fwkutil.cxx | |
parent | 4c5e2d7303b9536f28b0448d6884477dcc150359 (diff) |
#i20052#
Diffstat (limited to 'jvmfwk/source/fwkutil.cxx')
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 72 |
1 files changed, 35 insertions, 37 deletions
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index c90f4ebd6193..a9ab78218fc7 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fwkutil.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: jl $ $Date: 2004-05-13 11:15:02 $ + * last change: $Author: jl $ $Date: 2004-05-14 14:44:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -414,14 +414,34 @@ rtl::OUString getVendorSettingsURL() { //get the system path to the javavendors.xml file rtl::OUString sBaseDir = getBaseInstallation(); - if (sBaseDir.getLength() == 0) - return rtl::OUString(); + if (sBaseDir.getLength() != 0) + { + //We are run within office installation + rtl::OUStringBuffer sSettings(256); + sSettings.append(sBaseDir); + sSettings.appendAscii("/share/config/"); + sSettings.appendAscii(VENDORSETTINGS); + return sSettings.makeStringAndClear(); + } + else + { + //We are not in an office, try to find the javavendors.xml next to this + //library + rtl::OUString sLib; + if (osl_getModuleURLFromAddress((void *) & getVendorSettingsURL, + & sLib.pData) == sal_True) + { + rtl::OUStringBuffer sSettings(256); + sSettings.append(sLib); + sSettings.appendAscii("/"); + sLib = getDirFromFile(sLib); + sSettings.appendAscii(VENDORSETTINGS); + return sSettings.makeStringAndClear(); + } + else + return rtl::OUString(); - rtl::OUStringBuffer sSettings(256); - sSettings.append(sBaseDir); - sSettings.appendAscii("/share/config/"); - sSettings.appendAscii(VENDORSETTINGS); - return sSettings.makeStringAndClear(); + } } rtl::OString getVendorSettingsPath() @@ -757,12 +777,6 @@ void setJavaSelected() g_bJavaSet = true; } - - -/** Determines if the currently selected Java was set in this process. - - @see setProcessId() - */ bool wasJavaSelectedInSameProcess() { //g_setJavaProcId not set means no Java selected @@ -771,26 +785,10 @@ bool wasJavaSelectedInSameProcess() return false; } -// CProcessId::CProcessId():m_bValid(false) -// { -// } - -// void CProcessId::set() -// { -// rtl_getGlobalProcessId( m_arId); -// } - -// bool CProcessId::operator == (const sal_uInt8 * arId) const -// { -// if (arId == NULL || m_bValid == false) -// return false; -// if (memcmp(arId, m_arId, 16) == 0) -// return true; -// return false; -// } - -// bool CProcessId::isValid() const -// { -// return m_bValid; -// } +rtl::OUString getDirFromFile(const rtl::OUString& usFilePath) +{ + sal_Int32 index= usFilePath.lastIndexOf('/'); + return rtl::OUString(usFilePath.getStr(), index); +} + } |