diff options
Diffstat (limited to 'svtools/source/graphic/descriptor.cxx')
-rw-r--r-- | svtools/source/graphic/descriptor.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index d24911d60e25..1114923dc197 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -33,6 +33,7 @@ #include <vcl/graph.hxx> #include <vcl/svapp.hxx> +#include <boost/scoped_ptr.hpp> #define UNOGRAPHIC_GRAPHICTYPE 1 #define UNOGRAPHIC_MIMETYPE 2 @@ -82,13 +83,10 @@ void GraphicDescriptor::init( const ::Graphic& rGraphic ) void GraphicDescriptor::init( const OUString& rURL ) throw() { - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rURL, STREAM_READ ); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rURL, STREAM_READ )); if( pIStm ) - { implCreate( *pIStm, &rURL ); - delete pIStm; - } } @@ -96,13 +94,10 @@ void GraphicDescriptor::init( const OUString& rURL ) void GraphicDescriptor::init( const uno::Reference< io::XInputStream >& rxIStm, const OUString& rURL ) throw() { - SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( rxIStm ); + boost::scoped_ptr<SvStream> pIStm(::utl::UcbStreamHelper::CreateStream( rxIStm )); if( pIStm ) - { implCreate( *pIStm, &rURL ); - delete pIStm; - } } |