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 | |
parent | 4c5e2d7303b9536f28b0448d6884477dcc150359 (diff) |
#i20052#
Diffstat (limited to 'jvmfwk')
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 72 | ||||
-rw-r--r-- | jvmfwk/source/fwkutil.hxx | 6 | ||||
-rw-r--r-- | jvmfwk/source/libxmlutil.cxx | 41 |
3 files changed, 41 insertions, 78 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); +} + } diff --git a/jvmfwk/source/fwkutil.hxx b/jvmfwk/source/fwkutil.hxx index 92f17b029e6f..05106fcfa764 100644 --- a/jvmfwk/source/fwkutil.hxx +++ b/jvmfwk/source/fwkutil.hxx @@ -2,9 +2,9 @@ * * $RCSfile: fwkutil.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jl $ $Date: 2004-04-26 15:52:15 $ + * 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 @@ -97,6 +97,8 @@ rtl::OUString getVendorSettingsURL(); rtl::OString getVendorSettingsPath(); +rtl::OUString getDirFromFile(const rtl::OUString& usFilePath); + struct PluginLibrary; class VersionInfo; class CJavaInfo; diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx index 96f01a979f3c..6aae6df93eb3 100644 --- a/jvmfwk/source/libxmlutil.cxx +++ b/jvmfwk/source/libxmlutil.cxx @@ -2,9 +2,9 @@ * * $RCSfile: libxmlutil.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jl $ $Date: 2004-04-27 15:22:15 $ + * last change: $Author: jl $ $Date: 2004-05-14 14:44:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -160,39 +160,6 @@ CXmlDocPtr::operator xmlDoc*() } //=========================================================== -// CXmlNsPtr::CXmlNsPtr(xmlNs* pNs) -// : _object(pNs) -// { -// } - -// CXmlNsPtr::CXmlNsPtr():_object(NULL) -// { -// } - -// CXmlNsPtr::~CXmlNsPtr() -// { -// // xmlFreeNs(_object); -// } -// CXmlNsPtr & CXmlNsPtr::operator = (xmlNs* pObj) -// { -// if (_object == pObj) -// return *this; -// xmlFreeNs(_object); -// _object = pObj; -// return *this; -// } - -// xmlNs* CXmlNsPtr::operator ->() -// { -// return _object; -// } - -// CXmlNsPtr::operator xmlNs*() -// { -// return _object; -// } - -//=========================================================== CXmlCharPtr::CXmlCharPtr(xmlChar * aChar) : _object(aChar) { @@ -215,10 +182,6 @@ CXmlCharPtr & CXmlCharPtr::operator = (xmlChar* pObj) _object = pObj; return *this; } -// xmlChar* CXmlCharPtr::operator ->() -// { -// return _object; -// } CXmlCharPtr::operator xmlChar*() { |