diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-11 11:23:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-11 14:47:40 +0000 |
commit | bc09385ce297219f1976a9ca41a0b30902b9326d (patch) | |
tree | 5880e99b0428013647add66d3d553ee87fc43c17 /editeng/source | |
parent | af92221020fa2ef4d51fb4301e6878286a37ccca (diff) |
the pStream member makes no sense at all
maybe the PurgeMedia call in sw was meant to be a PurgeGraphic
call originally
(PurgeGraphic since removed by...
commit a22ac2c218870033822120bf0b0d6cfde6ce799f
Author: Caolán McNamara <caolanm@redhat.com>
Date: Thu Jul 14 22:06:29 2011 +0100
callcatcher: remove unused methods)
PurgeMedia releasing the stream makes no difference to the only place its used
which is SvxBrushItem::GetGraphicObject which makes a new one every time
anyway.
the SvxBrushItem assignment operator doesn't change the stream
member of the pImpl which looks utterly nuts, so its a good thing
the stream is not reused
Change-Id: Ie0dee22a6640a6916908fcddbc3541ba85034217
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/items/frmitems.cxx | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index a6618ea363ce..c71b754e32ac 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3267,8 +3267,6 @@ public: std::unique_ptr<GraphicObject> xGraphicObject; sal_Int8 nGraphicTransparency; //contains a percentage value which is //copied to the GraphicObject when necessary - std::unique_ptr<SvStream> xStream; - explicit SvxBrushItem_Impl(GraphicObject* p) : xGraphicObject(p) , nGraphicTransparency(0) @@ -3838,11 +3836,6 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) return rStream; } -void SvxBrushItem::PurgeMedium() const -{ - pImpl->xStream.reset(); -} - const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) const { if (bLoadAgain && !maStrLink.isEmpty() && !pImpl->xGraphicObject) @@ -3857,12 +3850,11 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co bool bGraphicLoaded = false; // try to create stream directly from given URL - pImpl->xStream.reset(utl::UcbStreamHelper::CreateStream(maStrLink, StreamMode::STD_READ)); - + std::unique_ptr<SvStream> xStream(utl::UcbStreamHelper::CreateStream(maStrLink, StreamMode::STD_READ)); // tdf#94088 if we have a stream, try to load it directly as graphic - if (pImpl->xStream && !pImpl->xStream->GetError()) + if (xStream && !xStream->GetError()) { - if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, maStrLink, *pImpl->xStream, + if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, maStrLink, *xStream, GRFILTER_FORMAT_DONTKNOW, nullptr, GraphicFilterImportFlags::DontSetLogsizeForJpeg)) { bGraphicLoaded = true; @@ -3877,10 +3869,10 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co if( INetProtocol::Data == aGraphicURL.GetProtocol() ) { - std::unique_ptr<SvMemoryStream> const xStream(aGraphicURL.getData()); - if (xStream) + std::unique_ptr<SvMemoryStream> const xMemStream(aGraphicURL.getData()); + if (xMemStream) { - if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, "", *xStream)) + if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, "", *xMemStream)) { bGraphicLoaded = true; |