summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-09 13:59:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-12 07:37:24 +0100
commit2f5868c4309d49ad495e0763b5b57d1f7f98e377 (patch)
treeba498138c67436ce30b5d9585353c50a1c5020bf /ucb
parentcb34e6083cdc82333d64ad9224e0d25e895d1dae (diff)
loplugin:redundantfcast look for redundant copies in return statements
Change-Id: I5f416c865dfe1c36018784246a8007452eb42008 Reviewed-on: https://gerrit.libreoffice.org/50996 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/core/cmdenv.cxx5
-rw-r--r--ucb/source/core/ucbcmds.cxx4
-rw-r--r--ucb/source/sorter/sortdynres.cxx5
-rw-r--r--ucb/source/ucp/file/filrset.hxx2
-rw-r--r--ucb/source/ucp/file/prov.cxx4
-rw-r--r--ucb/source/ucp/ftp/ftpcontentprovider.cxx6
-rw-r--r--ucb/source/ucp/ftp/ftpresultsetbase.hxx2
-rw-r--r--ucb/source/ucp/tdoc/tdoc_content.cxx13
-rw-r--r--ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx5
9 files changed, 19 insertions, 27 deletions
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index 03f84b893189..8c84e37a90cb 100644
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
@@ -140,12 +140,11 @@ uno::Reference< lang::XSingleServiceFactory >
UcbCommandEnvironment::createServiceFactory(
const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
{
- return uno::Reference< lang::XSingleServiceFactory >(
- cppu::createSingleFactory(
+ return cppu::createSingleFactory(
rxServiceMgr,
UcbCommandEnvironment::getImplementationName_Static(),
UcbCommandEnvironment_CreateInstance,
- UcbCommandEnvironment::getSupportedServiceNames_Static() ) );
+ UcbCommandEnvironment::getSupportedServiceNames_Static() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index bcedf21be3d6..9bfcd10883e2 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -252,7 +252,7 @@ CommandProcessorInfo::getCommandInfoByName( const OUString& Name )
for ( sal_Int32 n = 0; n < m_pInfo->getLength(); ++n )
{
if ( (*m_pInfo)[ n ].Name == Name )
- return ucb::CommandInfo( (*m_pInfo)[ n ] );
+ return (*m_pInfo)[ n ];
}
throw ucb::UnsupportedCommandException();
@@ -266,7 +266,7 @@ CommandProcessorInfo::getCommandInfoByHandle( sal_Int32 Handle )
for ( sal_Int32 n = 0; n < m_pInfo->getLength(); ++n )
{
if ( (*m_pInfo)[ n ].Handle == Handle )
- return ucb::CommandInfo( (*m_pInfo)[ n ] );
+ return (*m_pInfo)[ n ];
}
throw ucb::UnsupportedCommandException();
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 114d29c5f2e6..e3b20bd62539 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -459,12 +459,11 @@ css::uno::Sequence< OUString > SortedDynamicResultSetFactory::getSupportedServic
css::uno::Reference< css::lang::XSingleServiceFactory >
SortedDynamicResultSetFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
{
- return css::uno::Reference< css::lang::XSingleServiceFactory >(
- cppu::createOneInstanceFactory(
+ return cppu::createOneInstanceFactory(
rxServiceMgr,
SortedDynamicResultSetFactory::getImplementationName_Static(),
SortedDynamicResultSetFactory_CreateInstance,
- SortedDynamicResultSetFactory::getSupportedServiceNames_Static() ) );
+ SortedDynamicResultSetFactory::getSupportedServiceNames_Static() );
}
// SortedDynamicResultSetFactory methods.
diff --git a/ucb/source/ucp/file/filrset.hxx b/ucb/source/ucp/file/filrset.hxx
index fb6ec0a59313..61322afe7be5 100644
--- a/ucb/source/ucp/file/filrset.hxx
+++ b/ucb/source/ucp/file/filrset.hxx
@@ -158,7 +158,7 @@ class XResultSet_impl : public Notifier,
if( 0 <= m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) )
return m_aItems[m_nRow]->getInt( columnIndex );
else
- return sal_Int32( 0 );
+ return 0;
}
virtual sal_Int64 SAL_CALL
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 1c41642e30ce..e4cd53b40d99 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -140,11 +140,11 @@ Reference< XSingleServiceFactory >
FileProvider::createServiceFactory(
const Reference< XMultiServiceFactory >& rxServiceMgr )
{
- return Reference< XSingleServiceFactory > ( cppu::createSingleFactory(
+ return cppu::createSingleFactory(
rxServiceMgr,
fileaccess::TaskManager::getImplementationName_static(),
FileProvider::CreateInstance,
- fileaccess::TaskManager::getSupportedServiceNames_static() ) );
+ fileaccess::TaskManager::getSupportedServiceNames_static() );
}
Reference< XInterface > SAL_CALL
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index 1719d53efc47..80dffdce8659 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -136,13 +136,11 @@ css::uno::Reference< css::lang::XSingleServiceFactory >
FTPContentProvider::createServiceFactory( const css::uno::Reference<
css::lang::XMultiServiceFactory >& rxServiceMgr )
{
- return css::uno::Reference<
- css::lang::XSingleServiceFactory >(
- cppu::createOneInstanceFactory(
+ return cppu::createOneInstanceFactory(
rxServiceMgr,
FTPContentProvider::getImplementationName_Static(),
FTPContentProvider_CreateInstance,
- FTPContentProvider::getSupportedServiceNames_Static() ) );
+ FTPContentProvider::getSupportedServiceNames_Static() );
}
// XContentProvider methods.
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.hxx b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
index 0cf1e638a468..aae070a6a38e 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.hxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
@@ -134,7 +134,7 @@ namespace ftp {
if( 0 <= m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) )
return m_aItems[m_nRow]->getInt( columnIndex );
else
- return sal_Int32( 0 );
+ return 0;
}
virtual sal_Int64 SAL_CALL
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index e046b118a22d..67984008aabd 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -2696,8 +2696,7 @@ uno::Reference< io::XInputStream > Content::getInputStream(
try
{
osl::Guard< osl::Mutex > aGuard( m_aMutex );
- return uno::Reference< io::XInputStream >(
- m_pProvider->queryInputStream( aUri, aPassword ) );
+ return m_pProvider->queryInputStream( aUri, aPassword );
}
catch ( packages::WrongPasswordException const & )
{
@@ -2727,9 +2726,8 @@ static uno::Reference< io::XOutputStream > lcl_getTruncatedOutputStream(
{
try
{
- return uno::Reference< io::XOutputStream >(
- pProvider->queryOutputStream(
- rUri, aPassword, true /* truncate */ ) );
+ return pProvider->queryOutputStream(
+ rUri, aPassword, true /* truncate */ );
}
catch ( packages::WrongPasswordException const & )
{
@@ -2774,9 +2772,8 @@ uno::Reference< io::XStream > Content::getStream(
{
try
{
- return uno::Reference< io::XStream >(
- m_pProvider->queryStream(
- aUri, aPassword, false /* no truncate */ ) );
+ return m_pProvider->queryStream(
+ aUri, aPassword, false /* no truncate */ );
}
catch ( packages::WrongPasswordException const & )
{
diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
index 1bf916d3c35e..9a33a88bcc66 100644
--- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
@@ -136,12 +136,11 @@ uno::Reference< lang::XSingleServiceFactory >
DocumentContentFactory::createServiceFactory(
const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
{
- return uno::Reference< lang::XSingleServiceFactory >(
- cppu::createOneInstanceFactory(
+ return cppu::createOneInstanceFactory(
rxServiceMgr,
DocumentContentFactory::getImplementationName_Static(),
DocumentContentFactory_CreateInstance,
- DocumentContentFactory::getSupportedServiceNames_Static() ) );
+ DocumentContentFactory::getSupportedServiceNames_Static() );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */