diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 17:32:48 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-03-10 21:41:24 +0100 |
commit | 8546831b3b36e29c1ee42b790cbecd3fd8d8bbaf (patch) | |
tree | ef67dc83a9484c999ff1937469a582cff506ae2e | |
parent | 5dcdb35ab1e99dbeb283d3694ab7ebba354e9197 (diff) |
Turn JavaInfo sal_Sequence* member into rtl::ByteSequence
Change-Id: Iecd476970b0b7a46afe223f71e95b0010048d7b1
-rw-r--r-- | include/jvmfwk/framework.hxx | 8 | ||||
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 7 | ||||
-rw-r--r-- | jvmfwk/source/elements.cxx | 3 | ||||
-rw-r--r-- | jvmfwk/source/framework.cxx | 12 |
4 files changed, 10 insertions, 20 deletions
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx index 0380e1f68f7e..184b2c19b439 100644 --- a/include/jvmfwk/framework.hxx +++ b/include/jvmfwk/framework.hxx @@ -23,6 +23,7 @@ #define INCLUDED_JVMFWK_FRAMEWORK_HXX #include <jvmfwk/jvmfwkdllapi.hxx> +#include <rtl/byteseq.hxx> #include <rtl/ustring.h> #include <rtl/ustring.hxx> #include <osl/mutex.h> @@ -207,8 +208,7 @@ typedef enum _javaFrameworkError <p> Instances of this struct are created by the plug-in libraries which are used by - this framework (jvmfwk/vendorplugin.h). The contained members must be - freed individually. + this framework (jvmfwk/vendorplugin.h). For convenience this API provides the function <code>jfw_freeJavaInfo</code> which frees the objects properly. </p> */ @@ -254,7 +254,7 @@ struct JavaInfo values. The plug-in libraries can put all data, necessary for starting the java runtime into this sequence. </p> */ - sal_Sequence * arVendorData; + rtl::ByteSequence arVendorData; }; /** frees the memory of a <code>JavaInfo</code> object. @@ -271,7 +271,7 @@ JVMFWK_DLLPUBLIC void jfw_freeJavaInfo(JavaInfo *pInfo); in the second <code>JavaInfo</code> object. The equality of the <code>OUString</code> members is determined by <code>operator ==</code>. - Similarly the equality of the <code>sal_Sequence</code> is + Similarly the equality of the <code>rtl::ByteSequence</code> is also determined by a comparison function (see <code>rtl::ByteSequence::operator ==</code>). </p> <p> diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index 214a50137dd8..a3db87f687ad 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -162,10 +162,9 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) } OUString sVendorData = buf.makeStringAndClear(); - rtl::ByteSequence byteSeq( reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer), - sVendorData.getLength() * sizeof(sal_Unicode)); - pInfo->arVendorData = byteSeq.get(); - rtl_byte_sequence_acquire(pInfo->arVendorData); + pInfo->arVendorData = rtl::ByteSequence( + reinterpret_cast<sal_Int8*>(sVendorData.pData->buffer), + sVendorData.getLength() * sizeof(sal_Unicode)); return pInfo; } diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 8c6d590283e3..639e935b723f 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -984,8 +984,7 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const pInfo->sVersion = sVersion; pInfo->nFeatures = nFeatures; pInfo->nRequirements = nRequirements; - pInfo->arVendorData = arVendorData.getHandle(); - rtl_byte_sequence_acquire(pInfo->arVendorData); + pInfo->arVendorData = arVendorData; return pInfo; } diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index a6cac212bd67..6f9c45584d94 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -630,13 +630,12 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB) return true; if (pInfoA == nullptr || pInfoB == nullptr) return false; - rtl::ByteSequence sData(pInfoA->arVendorData); if (pInfoA->sVendor == pInfoB->sVendor && pInfoA->sLocation == pInfoB->sLocation && pInfoA->sVersion == pInfoB->sVersion && pInfoA->nFeatures == pInfoB->nFeatures && pInfoA->nRequirements == pInfoB->nRequirements - && sData == pInfoB->arVendorData) + && pInfoA->arVendorData == pInfoB->arVendorData) { return true; } @@ -646,9 +645,6 @@ bool jfw_areEqualJavaInfo(JavaInfo const * pInfoA,JavaInfo const * pInfoB) void jfw_freeJavaInfo(JavaInfo *pInfo) { - if (pInfo == nullptr) - return; - rtl_byte_sequence_release(pInfo->arVendorData); delete pInfo; } @@ -1073,11 +1069,7 @@ CJavaInfo::~CJavaInfo() JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo) { - if (pInfo == nullptr) - return nullptr; - JavaInfo* newInfo = new JavaInfo(*pInfo); - rtl_byte_sequence_acquire(newInfo->arVendorData); - return newInfo; + return pInfo == nullptr ? nullptr : new JavaInfo(*pInfo); } |