diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-13 16:17:00 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-08-03 06:37:16 +0000 |
commit | 2660d24a07866e083c5135ea263030f3e3a2e729 (patch) | |
tree | 0089d6018d4fc33a7fde955e585e77191cdd258b /oox | |
parent | baba1d14766282bd2c592bffd79ed69f9078cfe1 (diff) |
new loplugin: refcounting
This was a feature requested by mmeeks, as a result of
tdf#92611.
It validates that things that extend XInterface are not
directly heap/stack-allocated, but have their lifecycle managed
via css::uno::Reference or rtl::Reference.
Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692
Reviewed-on: https://gerrit.libreoffice.org/16924
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 535c81147ec0..122ee45d62c6 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -257,8 +257,8 @@ void XmlFilterBase::importDocumentProperties() MediaDescriptor aMediaDesc( getMediaDescriptor() ); Reference< XInputStream > xInputStream; Reference< XComponentContext > xContext = getComponentContext(); - ::oox::core::FilterDetect aDetector( xContext ); - xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc ); + Reference< ::oox::core::FilterDetect > xDetector( new ::oox::core::FilterDetect( xContext ) ); + xInputStream = xDetector->extractUnencryptedPackage( aMediaDesc ); Reference< XComponent > xModel( getModel(), UNO_QUERY ); Reference< XStorage > xDocumentStorage ( ::comphelper::OStorageHelper::GetStorageOfFormatFromInputStream( OFOPXML_STORAGE_FORMAT_STRING, xInputStream ) ); @@ -823,8 +823,8 @@ Reference< XInputStream > XmlFilterBase::implGetInputStream( MediaDescriptor& rM /* Get the input stream directly from the media descriptor, or decrypt the package again. The latter is needed e.g. when the document is reloaded. All this is implemented in the detector service. */ - FilterDetect aDetector( getComponentContext() ); - return aDetector.extractUnencryptedPackage( rMediaDesc ); + Reference< FilterDetect > xDetector( new FilterDetect( getComponentContext() ) ); + return xDetector->extractUnencryptedPackage( rMediaDesc ); } Reference<XStream> XmlFilterBase::implGetOutputStream( MediaDescriptor& rMediaDescriptor ) const |