diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 17:11:10 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 21:41:24 +0100 |
commit | 5dcdb35ab1e99dbeb283d3694ab7ebba354e9197 (patch) | |
tree | cf58a8092a68f07e3d4392eb423a596940cdcbae /jvmfwk | |
parent | 81dd7115e8da9a365a2d26e225f6ec4d2d8ccb5f (diff) |
Turn JavaInfo rtl_uString* members into OUString
Change-Id: Ieb23b0c36ef56a4793a56cdb450df34e4d9bce1d
Diffstat (limited to 'jvmfwk')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 14 | ||||
-rw-r--r-- | jvmfwk/source/elements.cxx | 9 | ||||
-rw-r--r-- | jvmfwk/source/framework.cxx | 20 |
3 files changed, 12 insertions, 31 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index e69420334736..214a50137dd8 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -147,15 +147,9 @@ OString getPluginJarPath( JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) { JavaInfo* pInfo = new JavaInfo; - OUString sVendor = info->getVendor(); - pInfo->sVendor = sVendor.pData; - rtl_uString_acquire(sVendor.pData); - OUString sHome = info->getHome(); - pInfo->sLocation = sHome.pData; - rtl_uString_acquire(pInfo->sLocation); - OUString sVersion = info->getVersion(); - pInfo->sVersion = sVersion.pData; - rtl_uString_acquire(pInfo->sVersion); + pInfo->sVendor = info->getVendor(); + pInfo->sLocation = info->getHome(); + pInfo->sVersion = info->getVersion(); pInfo->nFeatures = info->supportsAccessibility() ? 1 : 0; pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0; OUStringBuffer buf(1024); @@ -692,7 +686,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( #if defined UNX && !defined MACOSX //Setting the JAVA_HOME is needed for awt OUString sPathLocation; - osl_getSystemPathFromFileURL(pInfo->sLocation, & sPathLocation.pData); + osl::FileBase::getSystemPathFromFileURL(pInfo->sLocation, sPathLocation); osl_setEnvironment(OUString("JAVA_HOME").pData, sPathLocation.pData); #endif diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 60a1fa5cbe21..8c6d590283e3 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -979,12 +979,9 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const return nullptr; JavaInfo * pInfo = new JavaInfo; memset(pInfo, 0, sizeof(JavaInfo)); - pInfo->sVendor = sVendor.pData; - rtl_uString_acquire(pInfo->sVendor); - pInfo->sLocation = sLocation.pData; - rtl_uString_acquire(pInfo->sLocation); - pInfo->sVersion = sVersion.pData; - rtl_uString_acquire(pInfo->sVersion); + pInfo->sVendor = sVendor; + pInfo->sLocation = sLocation; + pInfo->sVersion = sVersion; pInfo->nFeatures = nFeatures; pInfo->nRequirements = nRequirements; pInfo->arVendorData = arVendorData.getHandle(); diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index e70e831e54b2..a6cac212bd67 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -630,13 +630,10 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB) return true; if (pInfoA == nullptr || pInfoB == nullptr) return false; - OUString sVendor(pInfoA->sVendor); - OUString sLocation(pInfoA->sLocation); - OUString sVersion(pInfoA->sVersion); rtl::ByteSequence sData(pInfoA->arVendorData); - if (sVendor.equals(pInfoB->sVendor) - && sLocation.equals(pInfoB->sLocation) - && sVersion.equals(pInfoB->sVersion) + if (pInfoA->sVendor == pInfoB->sVendor + && pInfoA->sLocation == pInfoB->sLocation + && pInfoA->sVersion == pInfoB->sVersion && pInfoA->nFeatures == pInfoB->nFeatures && pInfoA->nRequirements == pInfoB->nRequirements && sData == pInfoB->arVendorData) @@ -651,9 +648,6 @@ void jfw_freeJavaInfo(JavaInfo *pInfo) { if (pInfo == nullptr) return; - rtl_uString_release(pInfo->sVendor); - rtl_uString_release(pInfo->sLocation); - rtl_uString_release(pInfo->sVersion); rtl_byte_sequence_release(pInfo->arVendorData); delete pInfo; } @@ -1081,12 +1075,8 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo) { if (pInfo == nullptr) return nullptr; - JavaInfo* newInfo = new JavaInfo; - memcpy(newInfo, pInfo, sizeof(JavaInfo)); - rtl_uString_acquire(pInfo->sVendor); - rtl_uString_acquire(pInfo->sLocation); - rtl_uString_acquire(pInfo->sVersion); - rtl_byte_sequence_acquire(pInfo->arVendorData); + JavaInfo* newInfo = new JavaInfo(*pInfo); + rtl_byte_sequence_acquire(newInfo->arVendorData); return newInfo; } |