summaryrefslogtreecommitdiff
path: root/embeddedobj/source/commonembedding/miscobj.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 14:05:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-19 21:49:20 +0200
commit5043421fdc527d18d18121ec5fe2d4e009c8191a (patch)
treea93584cd705b362d254e509d556a2a9432ee88e5 /embeddedobj/source/commonembedding/miscobj.cxx
parent0f0adc34889ff68da584cea97a9de649174b0333 (diff)
loplugin:referencecasting in embeddedobj
Change-Id: I11a80e540b2a7da8d8037ba45e176d5c4d85374c Reviewed-on: https://gerrit.libreoffice.org/75951 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embeddedobj/source/commonembedding/miscobj.cxx')
-rw-r--r--embeddedobj/source/commonembedding/miscobj.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 48da9abdeaf7..557e21e2646a 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -439,7 +439,7 @@ uno::Reference< util::XCloseable > SAL_CALL OCommonEmbeddedObject::getComponent(
static_cast< ::cppu::OWeakObject* >(this) );
}
- return uno::Reference< util::XCloseable >( m_xDocHolder->GetComponent(), uno::UNO_QUERY );
+ return m_xDocHolder->GetComponent();
}
@@ -550,15 +550,9 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership )
// will use the storage, the storage will be disposed by the document and recreated by the object
if ( m_xObjectStorage.is() )
{
- uno::Reference< lang::XComponent > xComp( m_xObjectStorage, uno::UNO_QUERY );
- OSL_ENSURE( xComp.is(), "Storage does not support XComponent!" );
-
- if ( xComp.is() )
- {
- try {
- xComp->dispose();
- } catch ( const uno::Exception& ) {}
- }
+ try {
+ m_xObjectStorage->dispose();
+ } catch ( const uno::Exception& ) {}
m_xObjectStorage.clear();
m_xRecoveryStorage.clear();