diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-09-26 15:35:09 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-09-26 16:38:34 +0200 |
commit | ea2d767d4475ac3399fdfa59a4d0e2fbc38d1aa9 (patch) | |
tree | a0c57c0208e00a56bc498bdda7f7ae5db35ec746 /tools/source | |
parent | 325ce86b56131f1e874e8cb2c5948fed719afe07 (diff) |
tools: change INetURLObject::getData to return std::unique_ptr
Life-cycle becomes a lot more obvious this way.
Change-Id: I1ca99607f609a2223011c40447ad1cd9ca5ccaa5
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/fsys/urlobj.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx index 7e248a297643..e8331e85efbc 100644 --- a/tools/source/fsys/urlobj.cxx +++ b/tools/source/fsys/urlobj.cxx @@ -585,7 +585,9 @@ void INetURLObject::setInvalid() namespace { -SvMemoryStream * memoryStream(void const * data, sal_Int32 length) { +std::unique_ptr<SvMemoryStream> memoryStream( + void const * data, sal_Int32 length) +{ std::unique_ptr<char, boost::checked_array_deleter<char> > b( new char[length]); memcpy(b.get(), data, length); @@ -593,12 +595,12 @@ SvMemoryStream * memoryStream(void const * data, sal_Int32 length) { new SvMemoryStream(b.get(), length, STREAM_READ)); s->ObjectOwnsMemory(true); b.release(); - return s.release(); + return s; } } -SvMemoryStream* INetURLObject::getData() +std::unique_ptr<SvMemoryStream> INetURLObject::getData() { if( GetProtocol() != INET_PROT_DATA ) { |