summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-03-31 00:06:17 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-03-31 07:27:24 +0200
commit184be2d1352c5d3f3aa1e276d26c463c6e49b302 (patch)
tree65ee35397f445b264dcb05d0087aed60000f0e75 /ucb
parentf42d729e41da918bc496d5feb5861a09737c438a (diff)
tdf#120703 PVS: remove redundant static casts
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I54976062dc3f62eaaa79f89eff54454f0b24ac2c Reviewed-on: https://gerrit.libreoffice.org/69989 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/provprox.cxx4
-rw-r--r--ucb/source/core/ucbprops.cxx4
-rw-r--r--ucb/source/core/ucbstore.cxx5
-rw-r--r--ucb/source/sorter/sortdynres.cxx5
-rw-r--r--ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx4
5 files changed, 7 insertions, 15 deletions
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx
index 38b4d679153a..25e1a1d1ff74 100644
--- a/ucb/source/core/provprox.cxx
+++ b/ucb/source/core/provprox.cxx
@@ -54,9 +54,7 @@ XSERVICEINFO_COMMOM_IMPL( UcbContentProviderProxyFactory,
static css::uno::Reference< css::uno::XInterface >
UcbContentProviderProxyFactory_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
{
- css::lang::XServiceInfo* pX =
- static_cast<css::lang::XServiceInfo*>(new UcbContentProviderProxyFactory( rSMgr ));
- return css::uno::Reference< css::uno::XInterface >::query( pX );
+ return static_cast<css::lang::XServiceInfo*>(new UcbContentProviderProxyFactory(rSMgr));
}
css::uno::Sequence< OUString >
UcbContentProviderProxyFactory::getSupportedServiceNames_Static()
diff --git a/ucb/source/core/ucbprops.cxx b/ucb/source/core/ucbprops.cxx
index b8482c429c21..98f917621ed6 100644
--- a/ucb/source/core/ucbprops.cxx
+++ b/ucb/source/core/ucbprops.cxx
@@ -200,9 +200,7 @@ XSERVICEINFO_COMMOM_IMPL( UcbPropertiesManager,
static css::uno::Reference< css::uno::XInterface >
UcbPropertiesManager_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & /*rSMgr*/ )
{
- css::lang::XServiceInfo* pX =
- static_cast<css::lang::XServiceInfo*>(new UcbPropertiesManager);
- return css::uno::Reference< css::uno::XInterface >::query( pX );
+ return static_cast<css::lang::XServiceInfo*>(new UcbPropertiesManager);
}
css::uno::Sequence< OUString >
UcbPropertiesManager::getSupportedServiceNames_Static()
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 3454a7afd655..eb28a1eb3a7b 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -163,9 +163,8 @@ XSERVICEINFO_COMMOM_IMPL( UcbStore,
static css::uno::Reference< css::uno::XInterface >
UcbStore_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
{
- css::lang::XServiceInfo* pX =
- static_cast<css::lang::XServiceInfo*>(new UcbStore( ucbhelper::getComponentContext(rSMgr) ));
- return css::uno::Reference< css::uno::XInterface >::query( pX );
+ return static_cast<css::lang::XServiceInfo*>(
+ new UcbStore(ucbhelper::getComponentContext(rSMgr)));
}
css::uno::Sequence< OUString >
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 32bc6f7a3761..e5b34599ea0d 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -443,9 +443,8 @@ static css::uno::Reference< css::uno::XInterface >
SortedDynamicResultSetFactory_CreateInstance( const css::uno::Reference<
css::lang::XMultiServiceFactory> & rSMgr )
{
- css::lang::XServiceInfo* pX = static_cast<css::lang::XServiceInfo*>(
- new SortedDynamicResultSetFactory( ucbhelper::getComponentContext(rSMgr) ));
- return css::uno::Reference< css::uno::XInterface >::query( pX );
+ return static_cast<css::lang::XServiceInfo*>(
+ new SortedDynamicResultSetFactory(ucbhelper::getComponentContext(rSMgr)));
}
css::uno::Sequence< OUString > SortedDynamicResultSetFactory::getSupportedServiceNames_Static()
diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
index 4fc417010a0f..4aea87a897aa 100644
--- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
@@ -126,9 +126,7 @@ static uno::Reference< uno::XInterface >
DocumentContentFactory_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory> & rSMgr )
{
- lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >(
- new DocumentContentFactory( rSMgr ) );
- return uno::Reference< uno::XInterface >::query( pX );
+ return static_cast<lang::XServiceInfo*>(new DocumentContentFactory(rSMgr));
}