diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-20 18:25:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-21 08:49:23 +0200 |
commit | d943b42214321c630147176210733399c57e6f19 (patch) | |
tree | 0f3ad860167e066d3330e41983d762565085fd44 /ucb/source/ucp/tdoc | |
parent | bda438ecedaa86ca44228a193d3acd37eef4f818 (diff) |
loplugin:referencecasting in ucb
Change-Id: I2f0959c280a832fb80fd0dda263de5f9ae63a698
Reviewed-on: https://gerrit.libreoffice.org/76030
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/tdoc')
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 17 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_provider.cxx | 11 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_stgelems.cxx | 4 |
3 files changed, 9 insertions, 23 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 8a693fbe133b..9f9377a711e6 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -925,10 +925,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() ) { - xAdditionalPropSet.set( + xAdditionalPropSet = pProvider->getAdditionalPropertySet( rContentId, - false ), - uno::UNO_QUERY ); + false ); bTriedToGetAdditionalPropSet = true; } @@ -1019,9 +1018,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Append all Additional Core Properties. - uno::Reference< beans::XPropertySet > xSet( - pProvider->getAdditionalPropertySet( rContentId, false ), - uno::UNO_QUERY ); + uno::Reference< beans::XPropertySet > xSet = + pProvider->getAdditionalPropertySet( rContentId, false ); xRow->appendPropertySet( xSet ); } @@ -2131,12 +2129,7 @@ bool Content::hasData( ContentProvider const * pProvider, const Uri & rUri ) if ( !xStorage.is() ) return false; - uno::Reference< container::XNameAccess > xParentNA( - xStorage, uno::UNO_QUERY ); - - OSL_ENSURE( xParentNA.is(), "Got no css.container.XNameAccess!" ); - - return xParentNA->hasByName( rUri.getDecodedName() ); + return xStorage->hasByName( rUri.getDecodedName() ); } } diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index fdcfd241502c..9ef2524ae891 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -535,15 +535,8 @@ bool ContentProvider::queryNamesOfChildren( if ( xStorage.is() ) { - uno::Reference< container::XNameAccess > xNA( - xStorage, uno::UNO_QUERY ); - - OSL_ENSURE( xNA.is(), "Got no css.container.XNameAccess!" ); - if ( xNA.is() ) - { - rNames = xNA->getElementNames(); - return true; - } + rNames = xStorage->getElementNames(); + return true; } } catch ( embed::InvalidStorageException const & ) diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx index 937b33d3a082..b80db98d9554 100644 --- a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx +++ b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx @@ -66,7 +66,7 @@ Storage::Storage( const uno::Reference< uno::XComponentContext > & rxContext, m_xFactory( xFactory ), m_xWrappedStorage( xStorageToWrap ), m_xWrappedTransObj( xStorageToWrap, uno::UNO_QUERY ), // optional interface - m_xWrappedComponent( xStorageToWrap, uno::UNO_QUERY ), + m_xWrappedComponent( xStorageToWrap ), m_xWrappedTypeProv( xStorageToWrap, uno::UNO_QUERY ), m_bIsDocumentStorage( Uri( rUri ).isDocument() ) { @@ -620,7 +620,7 @@ Stream::Stream( m_xWrappedStream( xStreamToWrap ), m_xWrappedOutputStream( xStreamToWrap->getOutputStream() ), // might be empty m_xWrappedTruncate( m_xWrappedOutputStream, uno::UNO_QUERY ), // might be empty - m_xWrappedInputStream( xStreamToWrap->getInputStream(), uno::UNO_QUERY ), + m_xWrappedInputStream( xStreamToWrap->getInputStream() ), m_xWrappedComponent( xStreamToWrap, uno::UNO_QUERY ), m_xWrappedTypeProv( xStreamToWrap, uno::UNO_QUERY ) { |