diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:11:47 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:19 +0100 |
commit | fb4ce444c2239aa089b0b3c8f4b7629a624edea2 (patch) | |
tree | 518ecd4aeddc5d7b68a8051c66107751b7600451 | |
parent | 87a9abf351d1547638ec25c72d7fcb27d1b61440 (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: Ibd0e6ae5e3243464b2484a009f2b4781bdaac471
48 files changed, 163 insertions, 163 deletions
diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx index a8bd89639451..379ac9825338 100644 --- a/comphelper/source/container/container.cxx +++ b/comphelper/source/container/container.cxx @@ -31,7 +31,7 @@ namespace comphelper IndexAccessIterator::IndexAccessIterator(css::uno::Reference< css::uno::XInterface> xStartingPoint) :m_xStartingPoint(xStartingPoint) - ,m_xCurrentObject(NULL) + ,m_xCurrentObject(nullptr) { OSL_ENSURE(m_xStartingPoint.is(), "IndexAccessIterator::IndexAccessIterator : no starting point !"); } diff --git a/comphelper/source/container/containermultiplexer.cxx b/comphelper/source/container/containermultiplexer.cxx index 8758b4271225..c8fd633a0282 100644 --- a/comphelper/source/container/containermultiplexer.cxx +++ b/comphelper/source/container/containermultiplexer.cxx @@ -29,7 +29,7 @@ namespace comphelper using namespace ::com::sun::star::container; OContainerListener::OContainerListener(::osl::Mutex& _rMutex) - :m_pAdapter(NULL) + :m_pAdapter(nullptr) ,m_rMutex(_rMutex) { } @@ -40,7 +40,7 @@ namespace comphelper if (m_pAdapter) { m_pAdapter->dispose(); - m_pAdapter = NULL; + m_pAdapter = nullptr; } } @@ -75,7 +75,7 @@ namespace comphelper { ::osl::MutexGuard aGuard(m_rMutex); m_pAdapter->release(); - m_pAdapter = NULL; + m_pAdapter = nullptr; } if (pAdapter) @@ -121,14 +121,14 @@ namespace comphelper { Reference< XContainerListener > xPreventDelete(this); m_xContainer->removeContainerListener(xPreventDelete); - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); } catch(const Exception&) { OSL_FAIL("Exception caught!"); } - m_xContainer = NULL; - m_pListener = NULL; + m_xContainer = nullptr; + m_pListener = nullptr; } } @@ -142,11 +142,11 @@ namespace comphelper m_pListener->_disposing(_rSource); // disconnect the listener if ( m_pListener ) - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); } - m_xContainer = NULL; - m_pListener = NULL; + m_xContainer = nullptr; + m_pListener = nullptr; } diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 09e93dd3e515..33814fbde73f 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -101,7 +101,7 @@ EmbeddedObjectContainer::EmbeddedObjectContainer() pImpl->mxStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); pImpl->mbOwnsStorage = true; pImpl->mbUserAllowsLinkUpdate = true; - pImpl->mpTempObjectContainer = 0; + pImpl->mpTempObjectContainer = nullptr; } EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed::XStorage >& rStor ) @@ -110,7 +110,7 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed:: pImpl->mxStorage = rStor; pImpl->mbOwnsStorage = false; pImpl->mbUserAllowsLinkUpdate = true; - pImpl->mpTempObjectContainer = 0; + pImpl->mpTempObjectContainer = nullptr; } EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed::XStorage >& rStor, const uno::Reference < uno::XInterface >& xModel ) @@ -119,7 +119,7 @@ EmbeddedObjectContainer::EmbeddedObjectContainer( const uno::Reference < embed:: pImpl->mxStorage = rStor; pImpl->mbOwnsStorage = false; pImpl->mbUserAllowsLinkUpdate = true; - pImpl->mpTempObjectContainer = 0; + pImpl->mpTempObjectContainer = nullptr; pImpl->m_xModel = xModel; } @@ -438,7 +438,7 @@ void EmbeddedObjectContainer::AddEmbeddedObject( const css::uno::Reference < css if ( xStream.is() ) { InsertGraphicStream( xStream, rName, aMediaType ); - xStream = 0; + xStream = nullptr; pImpl->mpTempObjectContainer->RemoveGraphicStream( aTempName ); } diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index f8f3ea8a9a6d..897bd020ac3a 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -277,7 +277,7 @@ namespace comphelper const EnumerationType _type, const bool _isolated ) :ComponentBase( _rBHelper, ComponentBase::NoInitializationNeeded() ) ,m_xKeepMapAlive( _parentMap ) - ,m_pMapDataCopy( _isolated ? new MapData( _mapData ) : NULL ) + ,m_pMapDataCopy( _isolated ? new MapData( _mapData ) : nullptr ) ,m_aEnumerator( *this, _isolated ? *m_pMapDataCopy : _mapData, _type ) { } @@ -352,7 +352,7 @@ namespace comphelper throw IllegalTypeException("Unsupported value type.", *this ); // create the comparator for the KeyType, and throw if the type is not supported - ::std::unique_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) ); + ::std::unique_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, nullptr ) ); if ( !pComparator.get() ) throw IllegalTypeException("Unsupported key type.", *this ); @@ -442,7 +442,7 @@ namespace comphelper break; pValueCompoundTypeDesc = pValueCompoundTypeDesc->pBaseTypeDescription; } - bValid = ( pValueCompoundTypeDesc != NULL ); + bValid = ( pValueCompoundTypeDesc != nullptr ); } } break; diff --git a/comphelper/source/misc/SelectionMultiplex.cxx b/comphelper/source/misc/SelectionMultiplex.cxx index bff3e33819fa..26a191c21f30 100644 --- a/comphelper/source/misc/SelectionMultiplex.cxx +++ b/comphelper/source/misc/SelectionMultiplex.cxx @@ -50,7 +50,7 @@ void OSelectionChangeListener::setAdapter(OSelectionChangeMultiplexer* pAdapter) { ::osl::MutexGuard aGuard(m_rMutex); m_pAdapter->release(); - m_pAdapter = NULL; + m_pAdapter = nullptr; } if (pAdapter) @@ -103,13 +103,13 @@ void OSelectionChangeMultiplexer::dispose() m_xSet->removeSelectionChangeListener(xPreventDelete); - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); - m_pListener = NULL; + m_pListener = nullptr; m_bListening = false; if (m_bAutoSetRelease) - m_xSet = NULL; + m_xSet = nullptr; } } @@ -124,14 +124,14 @@ void SAL_CALL OSelectionChangeMultiplexer::disposing( const EventObject& _rSour m_pListener->_disposing(_rSource); // disconnect the listener if (m_pListener) // may have been reset whilest calling into _disposing - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); } - m_pListener = NULL; + m_pListener = nullptr; m_bListening = false; if (m_bAutoSetRelease) - m_xSet = NULL; + m_xSet = nullptr; } // XSelectionChangeListener diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx index de3209f0eb4d..ad56678b6c0c 100644 --- a/comphelper/source/misc/accessiblecontexthelper.cxx +++ b/comphelper/source/misc/accessiblecontexthelper.cxx @@ -60,7 +60,7 @@ namespace comphelper public: OContextHelper_Impl() - :m_pExternalLock( NULL ) + :m_pExternalLock( nullptr ) ,m_nClientId( 0 ) { } @@ -74,7 +74,7 @@ namespace comphelper OAccessibleContextHelper::OAccessibleContextHelper( IMutex* _pExternalLock ) :OAccessibleContextHelper_Base( GetMutex() ) - ,m_pImpl( NULL ) + ,m_pImpl( nullptr ) { assert(_pExternalLock); m_pImpl = new OContextHelper_Impl(); @@ -84,7 +84,7 @@ namespace comphelper void OAccessibleContextHelper::forgetExternalLock() { - m_pImpl->setExternalLock( NULL ); + m_pImpl->setExternalLock( nullptr ); } @@ -97,7 +97,7 @@ namespace comphelper ensureDisposed(); delete m_pImpl; - m_pImpl = NULL; + m_pImpl = nullptr; } diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx index c375abdfed70..8cf351993ef2 100644 --- a/comphelper/source/misc/accessibleeventnotifier.cxx +++ b/comphelper/source/misc/accessibleeventnotifier.cxx @@ -187,7 +187,7 @@ namespace comphelper void AccessibleEventNotifier::revokeClientNotifyDisposing( const TClientId _nClient, const Reference< XInterface >& _rxEventSource ) { - ::cppu::OInterfaceContainerHelper* pListeners(0); + ::cppu::OInterfaceContainerHelper* pListeners(nullptr); { // rhbz#1001768 drop the mutex before calling disposeAndClear diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx index 828e09b8d331..5e5262156e0d 100644 --- a/comphelper/source/misc/accessiblewrapper.cxx +++ b/comphelper/source/misc/accessiblewrapper.cxx @@ -347,7 +347,7 @@ namespace comphelper ,m_xInnerContext( _rxInnerAccessibleContext ) ,m_xOwningAccessible( _rxOwningAccessible ) ,m_xParentAccessible( _rxParentAccessible ) - ,m_pChildMapper( NULL ) + ,m_pChildMapper( nullptr ) { // initialize the mapper for our children m_pChildMapper = new OWrappedAccessibleChildrenManager( getComponentContext() ); @@ -385,7 +385,7 @@ namespace comphelper OSL_ENSURE( m_rBHelper.bDisposed, "OAccessibleContextWrapperHelper::~OAccessibleContextWrapperHelper: you should ensure (in your dtor) that the object is disposed!" ); m_pChildMapper->release(); - m_pChildMapper = NULL; + m_pChildMapper = nullptr; } diff --git a/comphelper/source/misc/accimplaccess.cxx b/comphelper/source/misc/accimplaccess.cxx index 757dbb5dcc10..e6a3f3cf4dc9 100644 --- a/comphelper/source/misc/accimplaccess.cxx +++ b/comphelper/source/misc/accimplaccess.cxx @@ -55,7 +55,7 @@ namespace comphelper OAccessibleImplementationAccess::~OAccessibleImplementationAccess( ) { delete m_pImpl; - m_pImpl = NULL; + m_pImpl = nullptr; } @@ -101,7 +101,7 @@ namespace comphelper OAccessibleImplementationAccess* OAccessibleImplementationAccess::getImplementation( const Reference< XAccessibleContext >& _rxComponent ) { - OAccessibleImplementationAccess* pImplementation = NULL; + OAccessibleImplementationAccess* pImplementation = nullptr; try { Reference< XUnoTunnel > xTunnel( _rxComponent, UNO_QUERY ); @@ -127,7 +127,7 @@ namespace comphelper if ( pImplementation ) pImplementation->setAccessibleParent( _rxNewParent ); - return ( NULL != pImplementation ); + return ( nullptr != pImplementation ); } diff --git a/comphelper/source/misc/anytostring.cxx b/comphelper/source/misc/anytostring.cxx index 11b1ade37d22..8a9056f028ac 100644 --- a/comphelper/source/misc/anytostring.cxx +++ b/comphelper/source/misc/anytostring.cxx @@ -61,7 +61,7 @@ void appendValue( OUStringBuffer & buf, buf.append( "void" ); return; } - assert(val != 0); + assert(val != nullptr); if (prependType && typeRef->eTypeClass != typelib_TypeClass_STRING && @@ -91,9 +91,9 @@ void appendValue( OUStringBuffer & buf, case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: { buf.append( "{ " ); - typelib_TypeDescription * typeDescr = 0; + typelib_TypeDescription * typeDescr = nullptr; typelib_typedescriptionreference_getDescription( &typeDescr, typeRef ); - if (typeDescr == 0 || !typelib_typedescription_complete( &typeDescr )) { + if (typeDescr == nullptr || !typelib_typedescription_complete( &typeDescr )) { appendTypeError( buf, typeRef ); } else { @@ -120,9 +120,9 @@ void appendValue( OUStringBuffer & buf, { buf.append( ppMemberNames[ nPos ] ); buf.append( " = " ); - typelib_TypeDescription * memberType = 0; + typelib_TypeDescription * memberType = nullptr; TYPELIB_DANGER_GET( &memberType, ppTypeRefs[ nPos ] ); - if (memberType == 0) { + if (memberType == nullptr) { appendTypeError( buf, ppTypeRefs[ nPos ] ); } else { @@ -137,23 +137,23 @@ void appendValue( OUStringBuffer & buf, } } buf.append( " }" ); - if (typeDescr != 0) + if (typeDescr != nullptr) typelib_typedescription_release( typeDescr ); break; } case typelib_TypeClass_SEQUENCE: { - typelib_TypeDescription * typeDescr = 0; + typelib_TypeDescription * typeDescr = nullptr; TYPELIB_DANGER_GET( &typeDescr, typeRef ); - if (typeDescr == 0) { + if (typeDescr == nullptr) { appendTypeError( buf,typeRef ); } else { typelib_TypeDescriptionReference * elementTypeRef = reinterpret_cast< typelib_IndirectTypeDescription * >(typeDescr)->pType; - typelib_TypeDescription * elementTypeDescr = 0; + typelib_TypeDescription * elementTypeDescr = nullptr; TYPELIB_DANGER_GET( &elementTypeDescr, elementTypeRef ); - if (elementTypeDescr == 0) + if (elementTypeDescr == nullptr) { appendTypeError( buf, elementTypeRef ); } @@ -219,9 +219,9 @@ void appendValue( OUStringBuffer & buf, break; } case typelib_TypeClass_ENUM: { - typelib_TypeDescription * typeDescr = 0; + typelib_TypeDescription * typeDescr = nullptr; typelib_typedescriptionreference_getDescription( &typeDescr, typeRef ); - if (typeDescr == 0 || !typelib_typedescription_complete( &typeDescr )) { + if (typeDescr == nullptr || !typelib_typedescription_complete( &typeDescr )) { appendTypeError( buf, typeRef ); } else @@ -246,7 +246,7 @@ void appendValue( OUStringBuffer & buf, buf.append( "?unknown enum value?" ); } } - if (typeDescr != 0) + if (typeDescr != nullptr) typelib_typedescription_release( typeDescr ); break; } diff --git a/comphelper/source/misc/componentbase.cxx b/comphelper/source/misc/componentbase.cxx index c8ce6baec423..2904e4675b23 100644 --- a/comphelper/source/misc/componentbase.cxx +++ b/comphelper/source/misc/componentbase.cxx @@ -49,7 +49,7 @@ namespace comphelper Reference< XInterface > ComponentBase::getComponent() { - return NULL; + return nullptr; } diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx index b06604ee6ed3..b51e84b194b6 100644 --- a/comphelper/source/misc/componentmodule.cxx +++ b/comphelper/source/misc/componentmodule.cxx @@ -140,7 +140,7 @@ namespace comphelper component->pComponentCreationFunc, component->sImplementationName, component->aSupportedServices, - NULL + nullptr ); if ( xReturn.is() ) { @@ -150,7 +150,7 @@ namespace comphelper } } - return NULL; + return nullptr; } diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx index bb0047506da1..8b93ff97f1fb 100644 --- a/comphelper/source/misc/configuration.cxx +++ b/comphelper/source/misc/configuration.cxx @@ -145,7 +145,7 @@ void comphelper::detail::ConfigurationWrapper::setPropertyValue( std::shared_ptr< ConfigurationChanges > const & batch, OUString const & path, css::uno::Any const & value) { - assert(batch.get() != 0); + assert(batch.get() != nullptr); batch->setPropertyValue(path, value); } @@ -161,7 +161,7 @@ void comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue( std::shared_ptr< ConfigurationChanges > const & batch, OUString const & path, css::uno::Any const & value) { - assert(batch.get() != 0); + assert(batch.get() != nullptr); batch->setPropertyValue(path, value); } @@ -181,7 +181,7 @@ comphelper::detail::ConfigurationWrapper::getGroupReadWrite( std::shared_ptr< ConfigurationChanges > const & batch, OUString const & path) { - assert(batch.get() != 0); + assert(batch.get() != nullptr); return batch->getGroup(path); } @@ -201,7 +201,7 @@ comphelper::detail::ConfigurationWrapper::getSetReadWrite( std::shared_ptr< ConfigurationChanges > const & batch, OUString const & path) { - assert(batch.get() != 0); + assert(batch.get() != nullptr); return batch->getSet(path); } diff --git a/comphelper/source/misc/evtmethodhelper.cxx b/comphelper/source/misc/evtmethodhelper.cxx index 01f5d6f65d12..d02b423bab57 100644 --- a/comphelper/source/misc/evtmethodhelper.cxx +++ b/comphelper/source/misc/evtmethodhelper.cxx @@ -28,7 +28,7 @@ namespace comphelper Sequence< OUString> getEventMethodsForType(const Type& type) { - typelib_InterfaceTypeDescription *pType=0; + typelib_InterfaceTypeDescription *pType=nullptr; type.getDescription(reinterpret_cast<typelib_TypeDescription**>(&pType)); if(!pType) @@ -41,7 +41,7 @@ namespace comphelper // the description reference typelib_TypeDescriptionReference* pMemberDescriptionReference = pType->ppMembers[i]; // the description for the reference - typelib_TypeDescription* pMemberDescription = NULL; + typelib_TypeDescription* pMemberDescription = nullptr; typelib_typedescriptionreference_getDescription(&pMemberDescription, pMemberDescriptionReference); if (pMemberDescription) { diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index d43ecf606923..145531d42915 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -42,8 +42,8 @@ using namespace ::com::sun::star; OInstanceLocker::OInstanceLocker( const uno::Reference< uno::XComponentContext >& xContext ) : m_xContext( xContext ) -, m_pLockListener( NULL ) -, m_pListenersContainer( NULL ) +, m_pLockListener( nullptr ) +, m_pListenersContainer( nullptr ) , m_bDisposed( false ) , m_bInitialized( false ) { @@ -65,7 +65,7 @@ OInstanceLocker::~OInstanceLocker() if ( m_pListenersContainer ) { delete m_pListenersContainer; - m_pListenersContainer = NULL; + m_pListenersContainer = nullptr; } } @@ -88,7 +88,7 @@ void SAL_CALL OInstanceLocker::dispose() if ( m_pLockListener ) { m_pLockListener->Dispose(); - m_pLockListener = NULL; + m_pLockListener = nullptr; } m_xLockListener.clear(); } diff --git a/comphelper/source/misc/namedvaluecollection.cxx b/comphelper/source/misc/namedvaluecollection.cxx index 62705ace667b..9f14078ad340 100644 --- a/comphelper/source/misc/namedvaluecollection.cxx +++ b/comphelper/source/misc/namedvaluecollection.cxx @@ -258,7 +258,7 @@ namespace comphelper aBuffer.append ( _rExpectedValueType.getTypeName() ); aBuffer.append( "\nFound: " ); aBuffer.append ( pos->second.getValueType().getTypeName() ); - throw IllegalArgumentException( aBuffer.makeStringAndClear(), NULL, 0 ); + throw IllegalArgumentException( aBuffer.makeStringAndClear(), nullptr, 0 ); } // argument does not exist diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx index eca8a8aeaad1..d03b8acf2517 100644 --- a/comphelper/source/misc/proxyaggregation.cxx +++ b/comphelper/source/misc/proxyaggregation.cxx @@ -86,7 +86,7 @@ namespace comphelper OProxyAggregation::~OProxyAggregation() { if ( m_xProxyAggregate.is() ) - m_xProxyAggregate->setDelegator( NULL ); + m_xProxyAggregate->setDelegator( nullptr ); m_xProxyAggregate.clear(); m_xProxyTypeAccess.clear(); // this should remove the _two_only_ "real" references (means not delegated to diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx index a70a73e3584b..ae12013d328f 100644 --- a/comphelper/source/misc/random.cxx +++ b/comphelper/source/misc/random.cxx @@ -39,7 +39,7 @@ struct RandomNumberGenerator STD_RNG_ALGO global_rng; RandomNumberGenerator() { - bool bRepeatable = (getenv("SAL_RAND_REPEATABLE") != 0); + bool bRepeatable = (getenv("SAL_RAND_REPEATABLE") != nullptr); if (bRepeatable) { global_rng.seed(42); diff --git a/comphelper/source/misc/servicedecl.cxx b/comphelper/source/misc/servicedecl.cxx index cff2432cf013..a7194ccf18fe 100644 --- a/comphelper/source/misc/servicedecl.cxx +++ b/comphelper/source/misc/servicedecl.cxx @@ -114,7 +114,7 @@ void * ServiceDecl::getFactory( sal_Char const* pImplName ) const pFac->acquire(); return pFac; } - return 0; + return nullptr; } uno::Sequence<OUString> ServiceDecl::getSupportedServiceNames() const diff --git a/comphelper/source/misc/solarmutex.cxx b/comphelper/source/misc/solarmutex.cxx index 1d2375440804..4b573078dffd 100644 --- a/comphelper/source/misc/solarmutex.cxx +++ b/comphelper/source/misc/solarmutex.cxx @@ -28,7 +28,7 @@ SolarMutex::SolarMutex() {} SolarMutex::~SolarMutex() {} namespace { - static SolarMutex* pSolarMutex = 0; + static SolarMutex* pSolarMutex = nullptr; } void SolarMutex::setSolarMutex( SolarMutex *pMutex ) diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index b2fe5d92903f..76280017493f 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -589,7 +589,7 @@ uno::Reference< io::XStream > OStorageHelper::GetStreamAtPackageURL( { return GetStreamAtPath(xParentStorage, path, nOpenMode, rNastiness); } - return 0; + return nullptr; } } diff --git a/comphelper/source/misc/syntaxhighlight.cxx b/comphelper/source/misc/syntaxhighlight.cxx index e071a93f5ec9..625490875567 100644 --- a/comphelper/source/misc/syntaxhighlight.cxx +++ b/comphelper/source/misc/syntaxhighlight.cxx @@ -344,7 +344,7 @@ bool SyntaxHighlighter::Tokenizer::getNextToken(const sal_Unicode*& pos, /*out*/ reType = TT_IDENTIFIER; // Keyword table - if (ppListKeyWords != NULL) + if (ppListKeyWords != nullptr) { int nCount = pos - rpStartPos; @@ -657,7 +657,7 @@ SyntaxHighlighter::Tokenizer::Tokenizer( HighlighterLanguage aLang ): aLanguage( aCharTypeTab[(int)'\r'] |= CHAR_EOL; aCharTypeTab[(int)'\n'] |= CHAR_EOL; - ppListKeyWords = NULL; + ppListKeyWords = nullptr; nKeyWordCount = 0; } diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx index 5732415c4008..9837ea6acf87 100644 --- a/comphelper/source/misc/threadpool.cxx +++ b/comphelper/source/misc/threadpool.cxx @@ -42,7 +42,7 @@ public: ThreadTask *waitForWork() { - ThreadTask *pRet = NULL; + ThreadTask *pRet = nullptr; osl::ResettableMutexGuard aGuard( mpPool->maGuard ); @@ -168,7 +168,7 @@ ThreadTask *ThreadPool::popWork() return pTask; } else - return NULL; + return nullptr; } void ThreadPool::startWork() diff --git a/comphelper/source/misc/types.cxx b/comphelper/source/misc/types.cxx index 51fe425a472d..aaf03be99502 100644 --- a/comphelper/source/misc/types.cxx +++ b/comphelper/source/misc/types.cxx @@ -122,10 +122,10 @@ FontDescriptor getDefaultFont() bool isAssignableFrom(const Type& _rAssignable, const Type& _rFrom) { // get the type lib descriptions - typelib_TypeDescription* pAssignable = NULL; + typelib_TypeDescription* pAssignable = nullptr; _rAssignable.getDescription(&pAssignable); - typelib_TypeDescription* pFrom = NULL; + typelib_TypeDescription* pFrom = nullptr; _rFrom.getDescription(&pFrom); // and ask the type lib diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx index 01d3efbe7a0c..4dc345f6b7fd 100644 --- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx +++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx @@ -95,8 +95,8 @@ OfficeInstallationDirectories::OfficeInstallationDirectories( : m_aOfficeBrandDirMacro( "$(brandbaseurl)" ), m_aUserDirMacro( "$(userdataurl)" ), m_xCtx( xCtx ), - m_pOfficeBrandDir( 0 ), - m_pUserDir( 0 ) + m_pOfficeBrandDir( nullptr ), + m_pUserDir( nullptr ) { } @@ -271,10 +271,10 @@ OfficeInstallationDirectories::Create( void OfficeInstallationDirectories::initDirs() { - if ( m_pOfficeBrandDir == 0 ) + if ( m_pOfficeBrandDir == nullptr ) { osl::MutexGuard aGuard( m_aMutex ); - if ( m_pOfficeBrandDir == 0 ) + if ( m_pOfficeBrandDir == nullptr ) { m_pOfficeBrandDir = new OUString; m_pUserDir = new OUString; diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 6f37c1e78448..269c63a22d6b 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -269,7 +269,7 @@ namespace comphelper { // XSet is only a workaround for addProperty not being able to add default-void properties. // So, everything of XSet except insert is implemented empty - return NULL; + return nullptr; } @@ -558,7 +558,7 @@ namespace comphelper ::cppu::IPropertyArrayHelper& rPropInfo = getInfoHelper(); sal_Int16 nAttributes(0); - OSL_VERIFY( rPropInfo.fillPropertyMembersByHandle( NULL, &nAttributes, _nHandle ) ); + OSL_VERIFY( rPropInfo.fillPropertyMembersByHandle( nullptr, &nAttributes, _nHandle ) ); if ( ( nAttributes & PropertyAttribute::MAYBEDEFAULT ) == 0 ) return PropertyState_DIRECT_VALUE; diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx index 10da011f70e1..05f4b05a4c6f 100644 --- a/comphelper/source/property/propagg.cxx +++ b/comphelper/source/property/propagg.cxx @@ -53,7 +53,7 @@ namespace comphelper Property aNameProp(_rName, 0, Type(), 0); const Property* pResult = ::std::lower_bound(pProperties, pProperties + nLen, aNameProp, PropertyCompareByName()); if ( pResult && ( pResult == pProperties + nLen || pResult->Name != _rName) ) - pResult = NULL; + pResult = nullptr; return pResult; } @@ -177,7 +177,7 @@ Property OPropertyArrayAggregationHelper::getPropertyByName( const OUString& _rP sal_Bool OPropertyArrayAggregationHelper::hasPropertyByName(const OUString& _rPropertyName) { - return NULL != findPropertyByName( _rPropertyName ); + return nullptr != findPropertyByName( _rPropertyName ); } @@ -614,7 +614,7 @@ sal_Int32 OPropertySetAggregationHelper::getOriginalHandle(sal_Int32 nHandle) co { OPropertyArrayAggregationHelper& rPH = static_cast<OPropertyArrayAggregationHelper&>( const_cast<OPropertySetAggregationHelper*>(this)->getInfoHelper() ); sal_Int32 nOriginalHandle = -1; - (void)rPH.fillAggregatePropertyInfoByHandle(NULL, &nOriginalHandle, nHandle); + (void)rPH.fillAggregatePropertyInfoByHandle(nullptr, &nOriginalHandle, nHandle); return nOriginalHandle; } @@ -819,7 +819,7 @@ void SAL_CALL OPropertySetAggregationHelper::setPropertyValues( if( pHandles[i] != -1 ) { sal_Int16 nAttributes; - rPH2.fillPropertyMembersByHandle( NULL, &nAttributes, pHandles[i] ); + rPH2.fillPropertyMembersByHandle( nullptr, &nAttributes, pHandles[i] ); if( nAttributes & css::beans::PropertyAttribute::READONLY ) throw css::beans::PropertyVetoException(); // Will the property change? diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx index bcf76091b920..c89804d8bba2 100644 --- a/comphelper/source/property/property.cxx +++ b/comphelper/source/property/property.cxx @@ -183,7 +183,7 @@ bool tryPropertyValue(Any& _rConvertedValue, Any& _rOldValue, const Any& _rValue { if ( _rValueToSet.hasValue() && ( !_rExpectedType.equals( _rValueToSet.getValueType() ) ) ) { - _rConvertedValue = Any( NULL, _rExpectedType.getTypeLibType() ); + _rConvertedValue = Any( nullptr, _rExpectedType.getTypeLibType() ); if ( !uno_type_assignData( const_cast< void* >( _rConvertedValue.getValue() ), _rConvertedValue.getValueType().getTypeLibType(), diff --git a/comphelper/source/property/propertybag.cxx b/comphelper/source/property/propertybag.cxx index daa05cd58935..c8820c2cc271 100644 --- a/comphelper/source/property/propertybag.cxx +++ b/comphelper/source/property/propertybag.cxx @@ -78,7 +78,7 @@ namespace comphelper throw IllegalArgumentException( "The property name must not be empty.", // TODO: resource - NULL, + nullptr, 1 ); } @@ -88,7 +88,7 @@ namespace comphelper if ( _container.hasPropertyByName( _name ) || _container.hasPropertyByHandle( _handle ) ) throw PropertyExistException( "Property name or handle already used.", - NULL ); + nullptr ); } @@ -97,7 +97,7 @@ namespace comphelper if ( _container.hasPropertyByName( _name ) || _container.hasPropertyByHandle( _handle ) ) throw ElementExistException( "Property name or handle already used.", - NULL ); + nullptr ); } @@ -110,7 +110,7 @@ namespace comphelper throw IllegalArgumentException( "Illegal property type: VOID", // TODO: resource - NULL, + nullptr, 1 ); @@ -120,7 +120,7 @@ namespace comphelper // register the property OSL_ENSURE( _nAttributes & PropertyAttribute::MAYBEVOID, "PropertyBag::addVoidProperty: this is for default-void properties only!" ); - registerPropertyNoMember( _rName, _nHandle, _nAttributes | PropertyAttribute::MAYBEVOID, _rType, NULL ); + registerPropertyNoMember( _rName, _nHandle, _nAttributes | PropertyAttribute::MAYBEVOID, _rType, nullptr ); // remember the default m_pImpl->aDefaults.insert( MapInt2Any::value_type( _nHandle, Any() ) ); @@ -135,7 +135,7 @@ namespace comphelper throw IllegalTypeException( "The initial value must be non-NULL to determine the property type.", // TODO: resource - NULL ); + nullptr ); // check name/handle sanity lcl_checkForEmptyName( m_pImpl->m_bAllowEmptyPropertyName, _rName ); @@ -143,7 +143,7 @@ namespace comphelper // register the property registerPropertyNoMember( _rName, _nHandle, _nAttributes, aPropertyType, - _rInitialValue.hasValue() ? _rInitialValue.getValue() : NULL ); + _rInitialValue.hasValue() ? _rInitialValue.getValue() : nullptr ); // remember the default m_pImpl->aDefaults.insert( MapInt2Any::value_type( _nHandle, _rInitialValue ) ); @@ -155,7 +155,7 @@ namespace comphelper const Property& rProp = getProperty( _rName ); // will throw an UnknownPropertyException if necessary if ( ( rProp.Attributes & PropertyAttribute::REMOVABLE ) == 0 ) - throw NotRemoveableException( OUString(), NULL ); + throw NotRemoveableException( OUString(), nullptr ); const sal_Int32 nHandle = rProp.Handle; revokeProperty( nHandle ); diff --git a/comphelper/source/property/propertycontainerhelper.cxx b/comphelper/source/property/propertycontainerhelper.cxx index 335919b02cb7..3ed8fc4f83f7 100644 --- a/comphelper/source/property/propertycontainerhelper.cxx +++ b/comphelper/source/property/propertycontainerhelper.cxx @@ -210,7 +210,7 @@ namespace aErrorMessage.append( "\", required property type \"" ); aErrorMessage.append( _rProperty.aProperty.Type.getTypeName() ); aErrorMessage.append( "\")" ); - throw IllegalArgumentException( aErrorMessage.makeStringAndClear(), NULL, 4 ); + throw IllegalArgumentException( aErrorMessage.makeStringAndClear(), nullptr, 4 ); } } @@ -246,7 +246,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue( // #i29490# if ( !aNewRequestedValue.getValueType().equals( aPos->aProperty.Type ) ) { // the actually given value is not of the same type as the one required - Any aProperlyTyped( NULL, aPos->aProperty.Type.getTypeLibType() ); + Any aProperlyTyped( nullptr, aPos->aProperty.Type.getTypeLibType() ); if ( uno_type_assignData( const_cast< void* >( aProperlyTyped.getValue() ), aProperlyTyped.getValueType().getTypeLibType(), @@ -272,7 +272,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue( lcl_throwIllegalPropertyValueTypeException( *aPos, _rValue ); } - Any* pPropContainer = NULL; + Any* pPropContainer = nullptr; // the pointer to the any which holds the property value, no matter if located in the derived class // or in out vector @@ -318,7 +318,7 @@ bool OPropertyContainerHelper::convertFastPropertyValue( bool bConverted = false; // a temporary any of the correct (required) type - aProperlyTyped = Any( NULL, aPos->aProperty.Type.getTypeLibType() ); + aProperlyTyped = Any( nullptr, aPos->aProperty.Type.getTypeLibType() ); // (need this as we do not want to overwrite the derived class member here) if ( uno_type_assignData( diff --git a/comphelper/source/property/propertysethelper.cxx b/comphelper/source/property/propertysethelper.cxx index de7df6a28b9d..daaadac738bc 100644 --- a/comphelper/source/property/propertysethelper.cxx +++ b/comphelper/source/property/propertysethelper.cxx @@ -50,7 +50,7 @@ PropertyMapEntry const * PropertySetHelperImpl::find( const OUString& aName ) co } else { - return NULL; + return nullptr; } } @@ -86,10 +86,10 @@ void SAL_CALL PropertySetHelper::setPropertyValue( const OUString& aPropertyName PropertyMapEntry const * aEntries[2]; aEntries[0] = mp->find( aPropertyName ); - if( NULL == aEntries[0] ) + if( nullptr == aEntries[0] ) throw UnknownPropertyException( aPropertyName, static_cast< XPropertySet* >( this ) ); - aEntries[1] = NULL; + aEntries[1] = nullptr; _setPropertyValues( aEntries, &aValue ); } @@ -99,10 +99,10 @@ Any SAL_CALL PropertySetHelper::getPropertyValue( const OUString& PropertyName ) PropertyMapEntry const * aEntries[2]; aEntries[0] = mp->find( PropertyName ); - if( NULL == aEntries[0] ) + if( nullptr == aEntries[0] ) throw UnknownPropertyException( PropertyName, static_cast< XPropertySet* >( this ) ); - aEntries[1] = NULL; + aEntries[1] = nullptr; Any aAny; _getPropertyValues( aEntries, &aAny ); @@ -142,7 +142,7 @@ void SAL_CALL PropertySetHelper::setPropertyValues( const Sequence< OUString >& if( nCount ) { std::unique_ptr<PropertyMapEntry const *[]> pEntries(new PropertyMapEntry const *[nCount+1]); - pEntries[nCount] = NULL; + pEntries[nCount] = nullptr; const OUString* pNames = rPropertyNames.getConstArray(); bool bUnknown = false; @@ -150,7 +150,7 @@ void SAL_CALL PropertySetHelper::setPropertyValues( const Sequence< OUString >& for( n = 0; !bUnknown && ( n < nCount ); n++, pNames++ ) { pEntries[n] = mp->find( *pNames ); - bUnknown = NULL == pEntries[n]; + bUnknown = nullptr == pEntries[n]; } if( !bUnknown ) @@ -170,7 +170,7 @@ Sequence< Any > SAL_CALL PropertySetHelper::getPropertyValues(const Sequence< OU if( nCount ) { std::unique_ptr<PropertyMapEntry const *[]> pEntries(new PropertyMapEntry const *[nCount+1]); - pEntries[nCount] = NULL; + pEntries[nCount] = nullptr; const OUString* pNames = rPropertyNames.getConstArray(); bool bUnknown = false; @@ -178,7 +178,7 @@ Sequence< Any > SAL_CALL PropertySetHelper::getPropertyValues(const Sequence< OU for( n = 0; !bUnknown && ( n < nCount ); n++, pNames++ ) { pEntries[n] = mp->find( *pNames ); - bUnknown = NULL == pEntries[n]; + bUnknown = nullptr == pEntries[n]; } if( !bUnknown ) @@ -215,10 +215,10 @@ PropertyState SAL_CALL PropertySetHelper::getPropertyState( const OUString& Prop PropertyMapEntry const * aEntries[2]; aEntries[0] = mp->find( PropertyName ); - if( aEntries[0] == NULL ) + if( aEntries[0] == nullptr ) throw UnknownPropertyException( PropertyName, static_cast< XPropertySet* >( this ) ); - aEntries[1] = NULL; + aEntries[1] = nullptr; PropertyState aState(PropertyState_AMBIGUOUS_VALUE); _getPropertyStates( aEntries, &aState ); @@ -244,10 +244,10 @@ Sequence< PropertyState > SAL_CALL PropertySetHelper::getPropertyStates( const S for( n = 0; !bUnknown && (n < nCount); n++, pNames++ ) { pEntries[n] = mp->find( *pNames ); - bUnknown = NULL == pEntries[n]; + bUnknown = nullptr == pEntries[n]; } - pEntries[nCount] = NULL; + pEntries[nCount] = nullptr; if( !bUnknown ) _getPropertyStates( pEntries.get(), aStates.getArray() ); @@ -262,7 +262,7 @@ Sequence< PropertyState > SAL_CALL PropertySetHelper::getPropertyStates( const S void SAL_CALL PropertySetHelper::setPropertyToDefault( const OUString& PropertyName ) throw(UnknownPropertyException, RuntimeException, std::exception) { PropertyMapEntry const *pEntry = mp->find( PropertyName ); - if( NULL == pEntry ) + if( nullptr == pEntry ) throw UnknownPropertyException( PropertyName, static_cast< XPropertySet* >( this ) ); _setPropertyToDefault( pEntry ); @@ -271,7 +271,7 @@ void SAL_CALL PropertySetHelper::setPropertyToDefault( const OUString& PropertyN Any SAL_CALL PropertySetHelper::getPropertyDefault( const OUString& aPropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception) { PropertyMapEntry const * pEntry = mp->find( aPropertyName ); - if( NULL == pEntry ) + if( nullptr == pEntry ) throw UnknownPropertyException( aPropertyName, static_cast< XPropertySet* >( this ) ); return _getPropertyDefault( pEntry ); diff --git a/comphelper/source/property/propmultiplex.cxx b/comphelper/source/property/propmultiplex.cxx index 51613c7b45f1..4c044abcb2c8 100644 --- a/comphelper/source/property/propmultiplex.cxx +++ b/comphelper/source/property/propmultiplex.cxx @@ -59,7 +59,7 @@ void OPropertyChangeListener::setAdapter(OPropertyChangeMultiplexer* pAdapter) { ::osl::MutexGuard aGuard(m_rMutex); m_pAdapter->release(); - m_pAdapter = NULL; + m_pAdapter = nullptr; } if (pAdapter) @@ -108,13 +108,13 @@ void OPropertyChangeMultiplexer::dispose() for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i, ++pProperties) m_xSet->removePropertyChangeListener(*pProperties, static_cast< XPropertyChangeListener*>(this)); - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); - m_pListener = NULL; + m_pListener = nullptr; m_bListening = false; if (m_bAutoSetRelease) - m_xSet = NULL; + m_xSet = nullptr; } } @@ -129,14 +129,14 @@ void SAL_CALL OPropertyChangeMultiplexer::disposing( const EventObject& _rSourc m_pListener->_disposing(_rSource); // disconnect the listener if (m_pListener) // may have been reset whilest calling into _disposing - m_pListener->setAdapter(NULL); + m_pListener->setAdapter(nullptr); } - m_pListener = NULL; + m_pListener = nullptr; m_bListening = false; if (m_bAutoSetRelease) - m_xSet = NULL; + m_xSet = nullptr; } // XPropertyChangeListener diff --git a/comphelper/source/streaming/oslfile2streamwrap.cxx b/comphelper/source/streaming/oslfile2streamwrap.cxx index 4b3dd8e81606..77e9ff6cfe31 100644 --- a/comphelper/source/streaming/oslfile2streamwrap.cxx +++ b/comphelper/source/streaming/oslfile2streamwrap.cxx @@ -130,7 +130,7 @@ void SAL_CALL OSLInputStreamWrapper::closeInput() throw( css::io::NotConnectedEx m_pFile->close(); - m_pFile = NULL; + m_pFile = nullptr; } /*************************************************************************/ diff --git a/include/comphelper/ChainablePropertySet.hxx b/include/comphelper/ChainablePropertySet.hxx index 7dda618c41b1..af074b0e147b 100644 --- a/include/comphelper/ChainablePropertySet.hxx +++ b/include/comphelper/ChainablePropertySet.hxx @@ -109,7 +109,7 @@ namespace comphelper throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException ); public: - ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, SolarMutex* pMutex = NULL ) + ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, SolarMutex* pMutex = nullptr ) throw(); virtual ~ChainablePropertySet() throw(); diff --git a/include/comphelper/IdPropArrayHelper.hxx b/include/comphelper/IdPropArrayHelper.hxx index 62d86d6137af..18367b09f103 100644 --- a/include/comphelper/IdPropArrayHelper.hxx +++ b/include/comphelper/IdPropArrayHelper.hxx @@ -60,7 +60,7 @@ namespace comphelper for (OIdPropertyArrayMap::iterator i = s_pMap->begin(); i != s_pMap->end(); ++i) delete (*i).second; delete s_pMap; - s_pMap = NULL; + s_pMap = nullptr; } } @@ -87,7 +87,7 @@ namespace comphelper sal_Int32 OIdPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0; template<class TYPE> - OIdPropertyArrayMap* OIdPropertyArrayUsageHelper< TYPE >::s_pMap = NULL; + OIdPropertyArrayMap* OIdPropertyArrayUsageHelper< TYPE >::s_pMap = nullptr; template <class TYPE> @@ -95,7 +95,7 @@ namespace comphelper { ::osl::MutexGuard aGuard(OIdPropertyArrayUsageHelperMutex<TYPE>::get()); // create the map if necessary - if (s_pMap == NULL) + if (s_pMap == nullptr) s_pMap = new OIdPropertyArrayMap(); ++s_nRefCount; } diff --git a/include/comphelper/MasterPropertySet.hxx b/include/comphelper/MasterPropertySet.hxx index 73d96ae1f469..c8818b5f658e 100644 --- a/include/comphelper/MasterPropertySet.hxx +++ b/include/comphelper/MasterPropertySet.hxx @@ -98,7 +98,7 @@ namespace comphelper throw(css::beans::UnknownPropertyException, css::lang::WrappedTargetException ); public: - MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, SolarMutex* pMutex = NULL ) + MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, SolarMutex* pMutex = nullptr ) throw(); virtual ~MasterPropertySet() throw(); diff --git a/include/comphelper/SelectionMultiplex.hxx b/include/comphelper/SelectionMultiplex.hxx index 5844f70f896b..fdfeba6587bd 100644 --- a/include/comphelper/SelectionMultiplex.hxx +++ b/include/comphelper/SelectionMultiplex.hxx @@ -49,7 +49,7 @@ namespace comphelper public: OSelectionChangeListener(::osl::Mutex& _rMutex) - : m_pAdapter(NULL), m_rMutex(_rMutex) { } + : m_pAdapter(nullptr), m_rMutex(_rMutex) { } virtual ~OSelectionChangeListener(); virtual void _selectionChanged( const css::lang::EventObject& aEvent ) throw (css::uno::RuntimeException) = 0; diff --git a/include/comphelper/SettingsHelper.hxx b/include/comphelper/SettingsHelper.hxx index 5bc33644b4d1..5ed0029643ec 100644 --- a/include/comphelper/SettingsHelper.hxx +++ b/include/comphelper/SettingsHelper.hxx @@ -40,7 +40,7 @@ namespace comphelper public ChainablePropertySet { public: - ChainableHelperNoState ( ChainablePropertySetInfo *pInfo, SolarMutex* pMutex = NULL) + ChainableHelperNoState ( ChainablePropertySetInfo *pInfo, SolarMutex* pMutex = nullptr) : ChainablePropertySet ( pInfo, pMutex ) {} virtual ~ChainableHelperNoState () throw( ) {} diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx index 7b06a308f600..fbd5d6336497 100644 --- a/include/comphelper/componentmodule.hxx +++ b/include/comphelper/componentmodule.hxx @@ -68,8 +68,8 @@ namespace comphelper :sImplementationName() ,aSupportedServices() ,sSingletonName() - ,pComponentCreationFunc( NULL ) - ,pFactoryCreationFunc( NULL ) + ,pComponentCreationFunc( nullptr ) + ,pFactoryCreationFunc( nullptr ) { } diff --git a/include/comphelper/container.hxx b/include/comphelper/container.hxx index 376406734935..ceae9f3c5586 100644 --- a/include/comphelper/container.hxx +++ b/include/comphelper/container.hxx @@ -57,7 +57,7 @@ public: css::uno::Reference< css::uno::XInterface> Next(); - virtual void Invalidate() { m_xCurrentObject = NULL; } + virtual void Invalidate() { m_xCurrentObject = nullptr; } protected: virtual bool ShouldHandleElement(const css::uno::Reference< css::uno::XInterface>& /*rElement*/) { return true; } diff --git a/include/comphelper/docpasswordhelper.hxx b/include/comphelper/docpasswordhelper.hxx index d4533c480a2c..ad973a21fe32 100644 --- a/include/comphelper/docpasswordhelper.hxx +++ b/include/comphelper/docpasswordhelper.hxx @@ -290,8 +290,8 @@ public: const css::uno::Reference< css::task::XInteractionHandler >& rxInteractHandler, const OUString& rDocumentUrl, DocPasswordRequestType eRequestType, - const ::std::vector< OUString >* pDefaultPasswords = 0, - bool* pbIsDefaultPassword = 0 ); + const ::std::vector< OUString >* pDefaultPasswords = nullptr, + bool* pbIsDefaultPassword = nullptr ); private: ~DocPasswordHelper(); diff --git a/include/comphelper/embeddedobjectcontainer.hxx b/include/comphelper/embeddedobjectcontainer.hxx index 6609c2aea095..f2b108d88631 100644 --- a/include/comphelper/embeddedobjectcontainer.hxx +++ b/include/comphelper/embeddedobjectcontainer.hxx @@ -140,14 +140,14 @@ public: bool MoveEmbeddedObject( const OUString& rName, EmbeddedObjectContainer& ); // get the stored representation for the object - css::uno::Reference < css::io::XInputStream > GetObjectStream( const css::uno::Reference < css::embed::XEmbeddedObject >&, OUString* pMediaType=0 ); + css::uno::Reference < css::io::XInputStream > GetObjectStream( const css::uno::Reference < css::embed::XEmbeddedObject >&, OUString* pMediaType=nullptr ); css::uno::Reference < css::io::XInputStream > GetObjectStream( const OUString& aName, OUString* pMediaType ); // get the stored graphical representation for the object - css::uno::Reference < css::io::XInputStream > GetGraphicStream( const css::uno::Reference < css::embed::XEmbeddedObject >&, OUString* pMediaType=0 ); + css::uno::Reference < css::io::XInputStream > GetGraphicStream( const css::uno::Reference < css::embed::XEmbeddedObject >&, OUString* pMediaType=nullptr ); // get the stored graphical representation by the object name - css::uno::Reference < css::io::XInputStream > GetGraphicStream( const OUString& aName, OUString* pMediaType=0 ); + css::uno::Reference < css::io::XInputStream > GetGraphicStream( const OUString& aName, OUString* pMediaType=nullptr ); // add a graphical representation for an object bool InsertGraphicStream( const css::uno::Reference < css::io::XInputStream >& rStream, const OUString& rObjectName, const OUString& rMediaType ); diff --git a/include/comphelper/logging.hxx b/include/comphelper/logging.hxx index ff7c8dff0f38..e8987314ab5e 100644 --- a/include/comphelper/logging.hxx +++ b/include/comphelper/logging.hxx @@ -130,7 +130,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ) ); return false; } @@ -140,7 +140,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ) ); return false; @@ -151,7 +151,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ) ); @@ -163,7 +163,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -176,7 +176,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -190,7 +190,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const OUString& _rMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, _rMessage, + return impl_log( _nLogLevel, nullptr, nullptr, _rMessage, OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -215,7 +215,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ) ); return false; } @@ -225,7 +225,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ) ); return false; @@ -236,7 +236,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ) ); @@ -248,7 +248,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -261,7 +261,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -275,7 +275,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Char* _pMessage, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, OUString::createFromAscii( _pMessage ), + return impl_log( _nLogLevel, nullptr, nullptr, OUString::createFromAscii( _pMessage ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -497,7 +497,7 @@ namespace comphelper ResourceBasedEventLogger( const css::uno::Reference< css::uno::XComponentContext >& _rxContext, const sal_Char* _pResourceBundleBaseName, - const sal_Char* _pAsciiLoggerName = NULL + const sal_Char* _pAsciiLoggerName = nullptr ); @@ -508,7 +508,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ) ); + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ) ); return false; } @@ -523,7 +523,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ) ); return false; } @@ -533,7 +533,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ) ); return false; @@ -544,7 +544,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ) ); @@ -556,7 +556,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -569,7 +569,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), @@ -583,7 +583,7 @@ namespace comphelper bool log( const sal_Int32 _nLogLevel, const sal_Int32 _nMessageResID, ARGTYPE1 _argument1, ARGTYPE2 _argument2, ARGTYPE3 _argument3, ARGTYPE4 _argument4, ARGTYPE5 _argument5, ARGTYPE6 _argument6 ) const { if ( isLoggable( _nLogLevel ) ) - return impl_log( _nLogLevel, NULL, NULL, impl_loadStringMessage_nothrow( _nMessageResID ), + return impl_log( _nLogLevel, nullptr, nullptr, impl_loadStringMessage_nothrow( _nMessageResID ), OptionalString( log::convert::convertLogArgToString( _argument1 ) ), OptionalString( log::convert::convertLogArgToString( _argument2 ) ), OptionalString( log::convert::convertLogArgToString( _argument3 ) ), diff --git a/include/comphelper/propagg.hxx b/include/comphelper/propagg.hxx index 8fc366bcf658..f598236d703d 100644 --- a/include/comphelper/propagg.hxx +++ b/include/comphelper/propagg.hxx @@ -120,7 +120,7 @@ public: */ OPropertyArrayAggregationHelper(const css::uno::Sequence< css::beans::Property>& _rProperties, const css::uno::Sequence< css::beans::Property>& _rAggProperties, - IPropertyInfoService* _pInfoService = NULL, + IPropertyInfoService* _pInfoService = nullptr, sal_Int32 _nFirstAggregateId = DEFAULT_AGGREGATE_PROPERTY_ID); diff --git a/include/comphelper/proparrhlp.hxx b/include/comphelper/proparrhlp.hxx index c78f736eb956..0f8fe7ebc36a 100644 --- a/include/comphelper/proparrhlp.hxx +++ b/include/comphelper/proparrhlp.hxx @@ -54,7 +54,7 @@ public: if (!--s_nRefCount) { delete s_pProps; - s_pProps = NULL; + s_pProps = nullptr; } } @@ -104,7 +104,7 @@ protected: Beware of the lifetime of the returned object, as it has to exist 'til the last instance of this class dies. */ - virtual IPropertyInfoService* getInfoService() const { return NULL; } + virtual IPropertyInfoService* getInfoService() const { return nullptr; } /** the return value is used for the construction of the OPropertyArrayAggregationHelper. */ @@ -115,7 +115,7 @@ template<class TYPE> sal_Int32 OPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0; template<class TYPE> -::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = NULL; +::cppu::IPropertyArrayHelper* OPropertyArrayUsageHelper< TYPE >::s_pProps = nullptr; template <class TYPE> OPropertyArrayUsageHelper<TYPE>::OPropertyArrayUsageHelper() diff --git a/include/comphelper/propmultiplex.hxx b/include/comphelper/propmultiplex.hxx index f6ba60a9580c..ac4eb02cd26d 100644 --- a/include/comphelper/propmultiplex.hxx +++ b/include/comphelper/propmultiplex.hxx @@ -48,7 +48,7 @@ namespace comphelper public: OPropertyChangeListener(::osl::Mutex& _rMutex) - : m_pAdapter(NULL), m_rMutex(_rMutex) { } + : m_pAdapter(nullptr), m_rMutex(_rMutex) { } virtual ~OPropertyChangeListener(); virtual void _propertyChanged(const css::beans::PropertyChangeEvent& _rEvent) diff --git a/include/comphelper/servicedecl.hxx b/include/comphelper/servicedecl.hxx index cb9a6f304d07..4447364d005a 100644 --- a/include/comphelper/servicedecl.hxx +++ b/include/comphelper/servicedecl.hxx @@ -338,7 +338,7 @@ template< typename T > inline void* component_getFactoryHelper( const sal_Char* pImplName, void* pRet, const T& s ) { - if( pRet == 0 ) + if( pRet == nullptr ) return s.getFactory( pImplName ); return pRet; } @@ -347,7 +347,7 @@ template< typename T, typename... Args > inline void* component_getFactoryHelper( const sal_Char* pImplName, void* pRet, const T& s, const Args&... args ) { - if( pRet == 0 ) + if( pRet == nullptr ) return component_getFactoryHelper( pImplName, s.getFactory( pImplName ), args... ); return pRet; } @@ -356,7 +356,7 @@ template< typename... Args > inline void* component_getFactoryHelper( const sal_Char* pImplName, const Args&... args ) { - void* pRet = 0; + void* pRet = nullptr; return component_getFactoryHelper( pImplName, pRet, args... ); } diff --git a/include/comphelper/servicehelper.hxx b/include/comphelper/servicehelper.hxx index 3d825b10fadf..622556616fd2 100644 --- a/include/comphelper/servicehelper.hxx +++ b/include/comphelper/servicehelper.hxx @@ -31,7 +31,7 @@ private: public: UnoTunnelIdInit() : m_aSeq(16) { - rtl_createUuid( reinterpret_cast<sal_uInt8*>(m_aSeq.getArray()), 0, sal_True ); + rtl_createUuid( reinterpret_cast<sal_uInt8*>(m_aSeq.getArray()), nullptr, sal_True ); } const css::uno::Sequence< sal_Int8 >& getSeq() const { return m_aSeq; } }; @@ -71,7 +71,7 @@ classname* classname::getImplementation( const uno::Reference< uno::XInterface > if( xUT.is() ) \ return reinterpret_cast<classname*>(sal::static_int_cast<sal_IntPtr>(xUT->getSomething( classname::getUnoTunnelId() ))); \ else \ - return NULL; \ + return nullptr; \ } #define UNO3_GETIMPLEMENTATION_IMPL( classname )\ |