diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 09:38:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-12 12:48:22 +0200 |
commit | feca66c513a681769c4b66ed1f1e0c70dada246c (patch) | |
tree | b2f806de7f370439fecc69dda5172ba671b799df /ucb | |
parent | 99e3703a845c643f17b589cf8174677ef88bb89a (diff) |
loplugin:simplifyconstruct in toolkit..ucb
Change-Id: Ica3efbdbf05a8161861b8be1ccdc62ab4aec1d69
Reviewed-on: https://gerrit.libreoffice.org/60371
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
20 files changed, 29 insertions, 75 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 77d897007076..5bd39fde2637 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -122,9 +122,7 @@ template<typename T> T CachedContentResultSet::rowOriginGet( CachedContentResultSet::CCRS_Cache::CCRS_Cache( const Reference< XContentIdentifierMapping > & xMapping ) - : m_pResult( nullptr ) - , m_xContentIdentifierMapping( xMapping ) - , m_pMappedReminder( nullptr ) + : m_xContentIdentifierMapping( xMapping ) { } @@ -425,8 +423,7 @@ static const char g_sPropertyNameForFetchDirection[] = "FetchDirection"; CCRS_PropertySetInfo::CCRS_PropertySetInfo( Reference< XPropertySetInfo > const & xInfo ) - : m_pProperties( nullptr ) - , m_nFetchSizePropertyHandle( -1 ) + : m_nFetchSizePropertyHandle( -1 ) , m_nFetchDirectionPropertyHandle( -1 ) { //initialize list of properties: @@ -640,8 +637,6 @@ CachedContentResultSet::CachedContentResultSet( : ContentResultSetWrapper( xOrigin ) , m_xContext( rxContext ) - , m_xFetchProvider( nullptr ) - , m_xFetchProviderForContentAccess( nullptr ) , m_xContentIdentifierMapping( xContentIdentifierMapping ) , m_nRow( 0 ) // Position is one-based. Zero means: before first element. @@ -662,7 +657,6 @@ CachedContentResultSet::CachedContentResultSet( , m_aCacheContentIdentifier( m_xContentIdentifierMapping ) , m_aCacheContent( m_xContentIdentifierMapping ) , m_bTriedToGetTypeConverter( false ) - , m_xTypeConverter( nullptr ) { m_xFetchProvider.set( m_xResultSetOrigin, UNO_QUERY ); OSL_ENSURE( m_xFetchProvider.is(), "interface XFetchProvider is required" ); diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx b/ucb/source/cacher/contentresultsetwrapper.cxx index 32e6f3edf59b..e7f264ee9b0c 100644 --- a/ucb/source/cacher/contentresultsetwrapper.cxx +++ b/ucb/source/cacher/contentresultsetwrapper.cxx @@ -43,17 +43,9 @@ using namespace cppu; ContentResultSetWrapper::ContentResultSetWrapper( Reference< XResultSet > const & xOrigin ) : m_xResultSetOrigin( xOrigin ) - , m_xRowOrigin( nullptr ) - , m_xContentAccessOrigin( nullptr ) - , m_xPropertySetOrigin( nullptr ) - , m_xPropertySetInfo( nullptr ) , m_nForwardOnly( 2 ) - , m_xMetaDataFromOrigin( nullptr ) , m_bDisposed( false ) , m_bInDispose( false ) - , m_pDisposeEventListeners( nullptr ) - , m_pPropertyChangeListeners( nullptr ) - , m_pVetoableChangeListeners( nullptr ) { m_xMyListenerImpl = new ContentResultSetWrapperListener( this ); diff --git a/ucb/source/cacher/dynamicresultsetwrapper.cxx b/ucb/source/cacher/dynamicresultsetwrapper.cxx index 643d2280cd5e..b52806fd76ee 100644 --- a/ucb/source/cacher/dynamicresultsetwrapper.cxx +++ b/ucb/source/cacher/dynamicresultsetwrapper.cxx @@ -45,18 +45,12 @@ DynamicResultSetWrapper::DynamicResultSetWrapper( : m_bDisposed( false ) , m_bInDispose( false ) - , m_pDisposeEventListeners( nullptr ) , m_xContext( rxContext ) , m_bStatic( false ) , m_bGotWelcome( false ) , m_xSource( xOrigin ) - , m_xSourceResultOne( nullptr ) - , m_xSourceResultTwo( nullptr ) // , m_xSourceResultCurrent( NULL ) // , m_bUseOne( NULL ) - , m_xMyResultOne( nullptr ) - , m_xMyResultTwo( nullptr ) - , m_xListener( nullptr ) { m_xMyListenerImpl = new DynamicResultSetWrapperListener( this ); //call impl_init() at the end of constructor of derived class @@ -67,7 +61,7 @@ void DynamicResultSetWrapper::impl_init() //call this at the end of constructor of derived class - Reference< XDynamicResultSet > xSource = nullptr; + Reference< XDynamicResultSet > xSource; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xSource = m_xSource; @@ -291,8 +285,8 @@ void SAL_CALL DynamicResultSetWrapper::setSource( const Reference< XInterface > OSL_ENSURE( xSourceDynamic.is(), "the given source is not of required type XDynamicResultSet" ); - Reference< XDynamicResultSetListener > xListener = nullptr; - Reference< XDynamicResultSetListener > xMyListenerImpl = nullptr; + Reference< XDynamicResultSetListener > xListener; + Reference< XDynamicResultSetListener > xMyListenerImpl; bool bStatic = false; { @@ -320,8 +314,8 @@ Reference< XResultSet > SAL_CALL DynamicResultSetWrapper::getStaticResultSet() { impl_EnsureNotDisposed(); - Reference< XDynamicResultSet > xSource = nullptr; - Reference< XEventListener > xMyListenerImpl = nullptr; + Reference< XDynamicResultSet > xSource; + Reference< XEventListener > xMyListenerImpl; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); if( m_xListener.is() ) @@ -350,8 +344,8 @@ void SAL_CALL DynamicResultSetWrapper::setListener( const Reference< XDynamicRes { impl_EnsureNotDisposed(); - Reference< XDynamicResultSet > xSource = nullptr; - Reference< XDynamicResultSetListener > xMyListenerImpl = nullptr; + Reference< XDynamicResultSet > xSource; + Reference< XDynamicResultSetListener > xMyListenerImpl; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); if( m_xListener.is() ) @@ -413,7 +407,7 @@ sal_Int16 SAL_CALL DynamicResultSetWrapper::getCapabilities() impl_EnsureNotDisposed(); m_aSourceSet.wait(); - Reference< XDynamicResultSet > xSource = nullptr; + Reference< XDynamicResultSet > xSource; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xSource = m_xSource; diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 02dccec24ed3..b60f0fd28c98 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -231,7 +231,6 @@ bool createContentProviderData( UniversalContentBroker::UniversalContentBroker( const Reference< css::uno::XComponentContext >& xContext ) : m_xContext( xContext ), - m_pDisposeEventListeners( nullptr ), m_nCommandId( 0 ) { OSL_ENSURE( m_xContext.is(), diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index 56bcbc39593b..f40e7008456b 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -1067,7 +1067,7 @@ struct PersistentPropertySet_Impl PersistentPropertySet_Impl( PropertySetRegistry& rCreator, const OUString& rKey ) - : m_pCreator( &rCreator ), m_pInfo( nullptr ), m_aKey( rKey ) + : m_pCreator( &rCreator ), m_aKey( rKey ) { } }; @@ -2074,8 +2074,7 @@ PropertySetRegistry& PersistentPropertySet::getPropertySetRegistry() PropertySetInfo_Impl::PropertySetInfo_Impl( PersistentPropertySet* pOwner ) -: m_pProps( nullptr ), - m_pOwner( pOwner ) +: m_pOwner( pOwner ) { } diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index d72191b7c144..d9771cfcb6d6 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -87,14 +87,9 @@ BaseContent::BaseContent( TaskManager* pMyShell, const OUString& parentName, bool bFolder ) : m_pMyShell( pMyShell ), - m_xContentIdentifier( nullptr ), m_aUncPath( parentName ), m_bFolder( bFolder ), - m_nState( JustInserted ), - m_pDisposeEventListeners( nullptr ), - m_pContentEventListeners( nullptr ), - m_pPropertySetInfoChangeListeners( nullptr ), - m_pPropertyListener( nullptr ) + m_nState( JustInserted ) { m_pMyShell->m_pProvider->acquire(); // No registering, since we have no name @@ -110,11 +105,7 @@ BaseContent::BaseContent( TaskManager* pMyShell, m_xContentIdentifier( xContentIdentifier ), m_aUncPath( aUncPath ), m_bFolder( false ), - m_nState( FullFeatured ), - m_pDisposeEventListeners( nullptr ), - m_pContentEventListeners( nullptr ), - m_pPropertySetInfoChangeListeners( nullptr ), - m_pPropertyListener( nullptr ) + m_nState( FullFeatured ) { m_pMyShell->m_pProvider->acquire(); m_pMyShell->registerNotifier( m_aUncPath,this ); @@ -896,7 +887,7 @@ BaseContent::open( sal_Int32 nMyCommandIdentifier, const OpenCommandArgument2& aCommandArgument ) { - Reference< XDynamicResultSet > retValue( nullptr ); + Reference< XDynamicResultSet > retValue; if( m_nState & Deleted ) { diff --git a/ucb/source/ucp/file/filrow.cxx b/ucb/source/ucp/file/filrow.cxx index 330bac6edf56..9701a5501972 100644 --- a/ucb/source/ucp/file/filrow.cxx +++ b/ucb/source/ucp/file/filrow.cxx @@ -81,8 +81,7 @@ bool convert( TaskManager* pShell, XRow_impl::XRow_impl( TaskManager* pMyShell,const uno::Sequence< uno::Any >& seq ) : m_aValueMap( seq ), m_nWasNull(false), - m_pMyShell( pMyShell ), - m_xTypeConverter( nullptr ) + m_pMyShell( pMyShell ) { } diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx index 00ea869e29c0..db6b756fd67c 100644 --- a/ucb/source/ucp/file/filrset.cxx +++ b/ucb/source/ucp/file/filrset.cxx @@ -61,9 +61,6 @@ XResultSet_impl::XResultSet_impl( TaskManager* pMyShell, , m_aFolder( aUnqPath ) , m_sProperty( seq ) , m_sSortingInfo( seqSort ) - , m_pDisposeEventListeners( nullptr ) - , m_pRowCountListeners( nullptr ) - , m_pIsFinalListeners( nullptr ) , m_nErrorCode( TASKHANDLER_NO_ERROR ) , m_nMinorErrorCode( TASKHANDLER_NO_ERROR ) { diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx index 6b0e5963ad04..d8110301cc60 100644 --- a/ucb/source/ucp/file/filtask.hxx +++ b/ucb/source/ucp/file/filtask.hxx @@ -102,7 +102,6 @@ namespace fileaccess m_bHandled( false ), m_nErrorCode( TASKHANDLER_NO_ERROR ), m_nMinorCode( TASKHANDLER_NO_ERROR ), - m_xInteractionHandler( nullptr ), m_xCommandEnvironment( xCommandEnv ) { } diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 0f63a480b380..ad1b0c6443e8 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -88,7 +88,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * ucpfile_component_getFactory( FileProvider::FileProvider( const Reference< XComponentContext >& rxContext ) : m_xContext(rxContext) , m_FileSystemNotation(FileSystemNotation::UNKNOWN_NOTATION) - , m_pMyShell(nullptr) { } diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx index 04dc472bb055..2133ae6fa087 100644 --- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx +++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx @@ -40,8 +40,6 @@ using namespace com::sun::star::beans; FTPContentProvider::FTPContentProvider( const Reference< XComponentContext >& rxContext) : ::ucbhelper::ContentProviderImplHelper(rxContext) - , m_ftpLoaderThread(nullptr) - , m_pProxyDecider(nullptr) { } diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.cxx b/ucb/source/ucp/ftp/ftpresultsetbase.cxx index d033bd0cf495..ec26c8624e17 100644 --- a/ucb/source/ucp/ftp/ftpresultsetbase.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetbase.cxx @@ -38,10 +38,7 @@ ResultSetBase::ResultSetBase( m_xProvider( xProvider ), m_nRow( -1 ), m_nWasNull( true ), - m_sProperty( seq ), - m_pDisposeEventListeners( nullptr ), - m_pRowCountListeners( nullptr ), - m_pIsFinalListeners( nullptr ) + m_sProperty( seq ) { } @@ -288,8 +285,7 @@ ResultSetBase::rowDeleted() uno::Reference< uno::XInterface > SAL_CALL ResultSetBase::getStatement() { - uno::Reference< uno::XInterface > test( nullptr ); - return test; + return uno::Reference< uno::XInterface >(); } diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx index 55e1af3b31c5..e211d125ab93 100644 --- a/ucb/source/ucp/hierarchy/hierarchydata.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx @@ -56,7 +56,7 @@ struct HierarchyEntry::iterator_Impl uno::Sequence< OUString> names; sal_Int32 pos; iterator_Impl() - : officeDirs( nullptr ), pos( -1 /* before first */ ) {}; + : pos( -1 /* before first */ ) {}; }; diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index 930879624d12..c19f2075597c 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -176,8 +176,7 @@ using namespace hcp_impl; HierarchyDataSource::HierarchyDataSource( const uno::Reference< uno::XComponentContext > & rxContext ) -: m_xContext( rxContext ), - m_pDisposeEventListeners( nullptr ) +: m_xContext( rxContext ) { } diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx index 5c1b6d263785..9adc171f6c76 100644 --- a/ucb/source/ucp/package/pkgprovider.cxx +++ b/ucb/source/ucp/package/pkgprovider.cxx @@ -92,8 +92,7 @@ using namespace package_ucp; // ContentProvider Implementation. ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rxContext ) -: ::ucbhelper::ContentProviderImplHelper( rxContext ), - m_pPackages( nullptr ) +: ::ucbhelper::ContentProviderImplHelper( rxContext ) { } diff --git a/ucb/source/ucp/webdav-neon/LinkSequence.cxx b/ucb/source/ucp/webdav-neon/LinkSequence.cxx index cad12cda2894..6cbf9f0df915 100644 --- a/ucb/source/ucp/webdav-neon/LinkSequence.cxx +++ b/ucb/source/ucp/webdav-neon/LinkSequence.cxx @@ -44,7 +44,7 @@ struct LinkSequenceParseContext bool hasDestination; LinkSequenceParseContext() - : pLink( nullptr ), hasSource( false ), hasDestination( false ) {} + : hasSource( false ), hasDestination( false ) {} }; #define STATE_TOP (1) diff --git a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx index 70b0c0ccc916..263211347820 100644 --- a/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx +++ b/ucb/source/ucp/webdav-neon/LockEntrySequence.cxx @@ -43,7 +43,7 @@ struct LockEntrySequenceParseContext bool hasType; LockEntrySequenceParseContext() - : pEntry( nullptr ), hasScope( false ), hasType( false ) {} + : hasScope( false ), hasType( false ) {} }; #define STATE_TOP (1) diff --git a/ucb/source/ucp/webdav-neon/LockSequence.cxx b/ucb/source/ucp/webdav-neon/LockSequence.cxx index 804452af5076..210a52ceb88d 100644 --- a/ucb/source/ucp/webdav-neon/LockSequence.cxx +++ b/ucb/source/ucp/webdav-neon/LockSequence.cxx @@ -46,7 +46,7 @@ struct LockSequenceParseContext bool hasTimeout; LockSequenceParseContext() - : pLock( nullptr ), hasLockScope( false ), hasLockType( false ), + : hasLockScope( false ), hasLockType( false ), hasDepth( false ), hasHREF( false ), hasTimeout( false ) {} }; diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx index 8d5f0c20d509..e17c1f03cfcc 100644 --- a/ucb/source/ucp/webdav-neon/NeonSession.cxx +++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx @@ -162,23 +162,23 @@ struct NeonRequestContext DAVResource * pResource; explicit NeonRequestContext( uno::Reference< io::XOutputStream > const & xOutStrm ) - : xOutputStream( xOutStrm ), xInputStream( nullptr ), + : xOutputStream( xOutStrm ), pHeaderNames( nullptr ), pResource( nullptr ) {} explicit NeonRequestContext( const rtl::Reference< NeonInputStream > & xInStrm ) - : xOutputStream( nullptr ), xInputStream( xInStrm ), + : xInputStream( xInStrm ), pHeaderNames( nullptr ), pResource( nullptr ) {} NeonRequestContext( uno::Reference< io::XOutputStream > const & xOutStrm, const std::vector< OUString > & inHeaderNames, DAVResource & ioResource ) - : xOutputStream( xOutStrm ), xInputStream( nullptr ), + : xOutputStream( xOutStrm ), pHeaderNames( &inHeaderNames ), pResource( &ioResource ) {} NeonRequestContext( const rtl::Reference< NeonInputStream > & xInStrm, const std::vector< OUString > & inHeaderNames, DAVResource & ioResource ) - : xOutputStream( nullptr ), xInputStream( xInStrm ), + : xInputStream( xInStrm ), pHeaderNames( &inHeaderNames ), pResource( &ioResource ) {} void ResponseBlockReader(const char * inBuf, size_t inLen) diff --git a/ucb/source/ucp/webdav-neon/webdavprovider.cxx b/ucb/source/ucp/webdav-neon/webdavprovider.cxx index 54d4ed5de655..2466c281e9c2 100644 --- a/ucb/source/ucp/webdav-neon/webdavprovider.cxx +++ b/ucb/source/ucp/webdav-neon/webdavprovider.cxx @@ -47,8 +47,7 @@ using namespace webdav_ucp; ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rxContext ) : ::ucbhelper::ContentProviderImplHelper( rxContext ), - m_xDAVSessionFactory( new DAVSessionFactory ), - m_pProps( nullptr ) + m_xDAVSessionFactory( new DAVSessionFactory ) { } |