From 346b5cfd9078826f8705e226ad317b2e4c58162d Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 11 Apr 2017 21:38:46 +0200 Subject: Convert some rtl_uString -> OUString in jvmfwk Change-Id: I08de5cab29dabc6fd824d5df8bac12c8520a05ae --- jvmfwk/inc/elements.hxx | 2 +- jvmfwk/source/elements.cxx | 8 +++----- jvmfwk/source/framework.cxx | 22 ++++++++-------------- 3 files changed, 12 insertions(+), 20 deletions(-) (limited to 'jvmfwk') diff --git a/jvmfwk/inc/elements.hxx b/jvmfwk/inc/elements.hxx index edf44ccc0f64..a2c17bfcaeb0 100644 --- a/jvmfwk/inc/elements.hxx +++ b/jvmfwk/inc/elements.hxx @@ -210,7 +210,7 @@ public: /** adds a location to the already existing locations. Note: call load() before, then add the location and then call write(). */ - void addJRELocation(rtl_uString * sLocation); + void addJRELocation(OUString const & sLocation); /** writes the data to user settings. */ diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 64258699713e..70c38e852eaf 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -645,18 +645,16 @@ void NodeJava::setVmParameters(rtl_uString * * arOptions, sal_Int32 size) } } -void NodeJava::addJRELocation(rtl_uString * sLocation) +void NodeJava::addJRELocation(OUString const & sLocation) { - assert( sLocation); if (!m_JRELocations) m_JRELocations = boost::optional >( std::vector ()); //only add the path if not already present std::vector::const_iterator it = - std::find(m_JRELocations->begin(), m_JRELocations->end(), - OUString(sLocation)); + std::find(m_JRELocations->begin(), m_JRELocations->end(), sLocation); if (it == m_JRELocations->end()) - m_JRELocations->push_back(OUString(sLocation)); + m_JRELocations->push_back(sLocation); } jfw::FileStatus NodeJava::checkSettingsFileStatus(OUString const & sURL) diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 9c3a35c56aca..5ae4c8773f71 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -641,9 +641,8 @@ javaFrameworkError jfw_getSelectedJRE(std::unique_ptr *ppInfo) if (jfw::getMode() == jfw::JFW_MODE_DIRECT) { - OUString sJRE = jfw::BootParams::getJREHome(); - - if ((errcode = jfw_getJavaInfoByPath(sJRE.pData, ppInfo)) + if ((errcode = jfw_getJavaInfoByPath( + jfw::BootParams::getJREHome(), ppInfo)) != JFW_E_NONE) throw jfw::FrameworkException( JFW_E_CONFIGURATION, @@ -688,17 +687,14 @@ bool jfw_isVMRunning() return g_pJavaVM != nullptr; } -javaFrameworkError jfw_getJavaInfoByPath(rtl_uString *pPath, std::unique_ptr *ppInfo) +javaFrameworkError jfw_getJavaInfoByPath(OUString const & pPath, std::unique_ptr *ppInfo) { - assert(pPath != nullptr); assert(ppInfo != nullptr); javaFrameworkError errcode = JFW_E_NONE; try { osl::MutexGuard guard(jfw::FwkMutex::get()); - OUString ouPath(pPath); - jfw::VendorSettings aVendorSettings; std::vector vecVendors = aVendorSettings.getSupportedVendors(); @@ -717,7 +713,7 @@ javaFrameworkError jfw_getJavaInfoByPath(rtl_uString *pPath, std::unique_ptr