summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx9
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.hxx2
2 files changed, 5 insertions, 6 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index d00662375dfc..8550613ad6db 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -6042,6 +6042,8 @@ RTFError RTFDocumentImpl::handleEmbeddedObject()
}
}
+ std::unique_ptr<SvStream> pStream(new SvMemoryStream());
+
// Skip ObjectHeader, see [MS-OLEDS] 2.2.4.
if (aStream.Tell())
{
@@ -6059,13 +6061,12 @@ RTFError RTFDocumentImpl::handleEmbeddedObject()
if (nData)
{
- m_pObjectData.reset(new SvMemoryStream());
- m_pObjectData->WriteStream(aStream);
- m_pObjectData->Seek(0);
+ pStream->WriteStream(aStream);
+ pStream->Seek(0);
}
}
- uno::Reference<io::XInputStream> xInputStream(new utl::OSeekableInputStreamWrapper(m_pObjectData.get()));
+ uno::Reference<io::XInputStream> xInputStream(new utl::OSeekableInputStreamWrapper(pStream.release(), /*_bOwner=*/true));
auto pStreamValue = std::make_shared<RTFValue>(xInputStream);
m_aOLEAttributes.set(NS_ooxml::LN_inputstream, pStreamValue);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
index 0af39d3ae98a..dddd0eeb6509 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx
@@ -548,8 +548,6 @@ private:
* \objdata element.
* (if we don't use the \objdata we use the \result element)*/
bool m_bObject;
- /// Contents of the objdata group.
- std::shared_ptr<SvStream> m_pObjectData;
/// If the data for a picture is a binary one, it's stored here.
std::shared_ptr<SvStream> m_pBinaryData;