summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-20 18:25:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-21 08:49:23 +0200
commitd943b42214321c630147176210733399c57e6f19 (patch)
tree0f3ad860167e066d3330e41983d762565085fd44 /ucb
parentbda438ecedaa86ca44228a193d3acd37eef4f818 (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')
-rw-r--r--ucb/source/cacher/dynamicresultsetwrapper.cxx4
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx10
-rw-r--r--ucb/source/ucp/package/pkgcontent.cxx10
-rw-r--r--ucb/source/ucp/tdoc/tdoc_content.cxx17
-rw-r--r--ucb/source/ucp/tdoc/tdoc_provider.cxx11
-rw-r--r--ucb/source/ucp/tdoc/tdoc_stgelems.cxx4
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx10
7 files changed, 23 insertions, 43 deletions
diff --git a/ucb/source/cacher/dynamicresultsetwrapper.cxx b/ucb/source/cacher/dynamicresultsetwrapper.cxx
index 042a63c57c55..e33f710f0724 100644
--- a/ucb/source/cacher/dynamicresultsetwrapper.cxx
+++ b/ucb/source/cacher/dynamicresultsetwrapper.cxx
@@ -135,7 +135,7 @@ void SAL_CALL DynamicResultSetWrapper::dispose()
return;
m_bInDispose = true;
- xSourceComponent.set(m_xSource, UNO_QUERY);
+ xSourceComponent = m_xSource;
if( m_pDisposeEventListeners && m_pDisposeEventListeners->getLength() )
{
@@ -326,7 +326,7 @@ Reference< XResultSet > SAL_CALL DynamicResultSetWrapper::getStaticResultSet()
xSource = m_xSource;
m_bStatic = true;
- xMyListenerImpl.set( css::uno::Reference< css::ucb::XDynamicResultSetListener >(m_xMyListenerImpl.get()), UNO_QUERY );
+ xMyListenerImpl = m_xMyListenerImpl.get();
}
if( xSource.is() )
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index 65051e16c193..4b55810aa923 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -889,10 +889,9 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues(
if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() )
{
- xAdditionalPropSet.set(
+ xAdditionalPropSet =
pProvider->getAdditionalPropertySet( rContentId,
- false ),
- uno::UNO_QUERY );
+ false );
bTriedToGetAdditionalPropSet = true;
}
@@ -965,9 +964,8 @@ uno::Reference< sdbc::XRow > HierarchyContent::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 );
}
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx
index 85cb0b16d3c8..8399b2298f12 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -811,10 +811,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() )
{
- xAdditionalPropSet.set(
+ xAdditionalPropSet =
rProvider->getAdditionalPropertySet( rContentId,
- false ),
- uno::UNO_QUERY );
+ false );
bTriedToGetAdditionalPropSet = true;
}
@@ -932,9 +931,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
// Append all Additional Core Properties.
- uno::Reference< beans::XPropertySet > xSet(
- rProvider->getAdditionalPropertySet( rContentId, false ),
- uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xSet =
+ rProvider->getAdditionalPropertySet( rContentId, false );
xRow->appendPropertySet( xSet );
}
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 )
{
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 25941bce6c13..cb1e2e02d2fc 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -1213,10 +1213,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
// Process local Additional Properties.
if ( !bTriedToGetAdditionalPropSet && !xAdditionalPropSet.is() )
{
- xAdditionalPropSet.set(
+ xAdditionalPropSet =
rProvider->getAdditionalPropertySet( rContentId,
- false ),
- uno::UNO_QUERY );
+ false );
bTriedToGetAdditionalPropSet = true;
}
@@ -1246,9 +1245,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
}
// Append all local Additional Properties.
- uno::Reference< beans::XPropertySet > xSet(
- rProvider->getAdditionalPropertySet( rContentId, false ),
- uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xSet =
+ rProvider->getAdditionalPropertySet( rContentId, false );
xRow->appendPropertySet( xSet );
}