loplugin:nullptr (automatic rewrite)

Change-Id: I62a63915dfc0bced2cd8ffe3999cbde5c4d97b0b
This commit is contained in:
Stephan Bergmann
2015-11-10 10:13:11 +01:00
parent 4730b58d99
commit bf3f840302
28 changed files with 157 additions and 157 deletions

View File

@@ -156,7 +156,7 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]); pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL); CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2); CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 2);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]); CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
@@ -174,7 +174,7 @@ namespace cppu_ifcontainer
pHelper = pContainer->getContainer(pTypes[i]); pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL); CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1); CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 1);
CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]); CPPUNIT_ASSERT_MESSAGE("match", aSeq[0] == xRefs[i*2]);
@@ -190,7 +190,7 @@ namespace cppu_ifcontainer
cppu::OInterfaceContainerHelper *pHelper; cppu::OInterfaceContainerHelper *pHelper;
pHelper = pContainer->getContainer(pTypes[i]); pHelper = pContainer->getContainer(pTypes[i]);
CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != NULL); CPPUNIT_ASSERT_MESSAGE("no helper", pHelper != nullptr);
Sequence<Reference< XInterface > > aSeq = pHelper->getElements(); Sequence<Reference< XInterface > > aSeq = pHelper->getElements();
CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0); CPPUNIT_ASSERT_MESSAGE("wrong num elements", aSeq.getLength() == 0);
} }

View File

@@ -103,7 +103,7 @@ void AccessControl::checkRuntimePermission(
{ {
__checkPermission( __checkPermission(
m_xController, m_xController,
cppu::UnoType<security::RuntimePermission>::get(), name.pData, 0 ); cppu::UnoType<security::RuntimePermission>::get(), name.pData, nullptr );
} }
void AccessControl::checkFilePermission( void AccessControl::checkFilePermission(

View File

@@ -91,7 +91,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
try try
{ {
char const * p1 = cppuhelper_detail_findSofficePath(); char const * p1 = cppuhelper_detail_findSofficePath();
if (p1 == NULL) { if (p1 == nullptr) {
throw BootstrapException( throw BootstrapException(
"no soffice installation found!"); "no soffice installation found!");
} }
@@ -136,7 +136,7 @@ Reference< XComponentContext > SAL_CALL bootstrap()
// create a random pipe name // create a random pipe name
rtlRandomPool hPool = rtl_random_createPool(); rtlRandomPool hPool = rtl_random_createPool();
if ( hPool == 0 ) if ( hPool == nullptr )
throw BootstrapException( "cannot create random pool!" ); throw BootstrapException( "cannot create random pool!" );
sal_uInt8 bytes[ 16 ]; sal_uInt8 bytes[ 16 ];
if ( rtl_random_getBytes( hPool, bytes, ARLEN( bytes ) ) if ( rtl_random_getBytes( hPool, bytes, ARLEN( bytes ) )
@@ -166,13 +166,13 @@ Reference< XComponentContext > SAL_CALL bootstrap()
::osl::Security sec; ::osl::Security sec;
// start office process // start office process
oslProcess hProcess = 0; oslProcess hProcess = nullptr;
oslProcessError rc = osl_executeProcess( oslProcessError rc = osl_executeProcess(
OUString(path + "soffice").pData, ar_args, ARLEN( ar_args ), OUString(path + "soffice").pData, ar_args, ARLEN( ar_args ),
osl_Process_DETACHED, osl_Process_DETACHED,
sec.getHandle(), sec.getHandle(),
0, // => current working dir nullptr, // => current working dir
0, 0, // => no env vars nullptr, 0, // => no env vars
&hProcess ); &hProcess );
switch ( rc ) switch ( rc )
{ {

View File

@@ -115,7 +115,7 @@ void OComponentHelper::release() throw()
Sequence< Type > OComponentHelper::getTypes() throw (RuntimeException, std::exception) Sequence< Type > OComponentHelper::getTypes() throw (RuntimeException, std::exception)
{ {
static OTypeCollection * s_pTypes = 0; static OTypeCollection * s_pTypes = nullptr;
if (! s_pTypes) if (! s_pTypes)
{ {
MutexGuard aGuard( Mutex::getGlobalMutex() ); MutexGuard aGuard( Mutex::getGlobalMutex() );

View File

@@ -877,7 +877,7 @@ Reference< XComponentContext > SAL_CALL createComponentContext(
} }
void * mapped_delegate = curr2source.mapInterface(xDelegate.get(), cppu::UnoType<decltype(xDelegate)>::get()); void * mapped_delegate = curr2source.mapInterface(xDelegate.get(), cppu::UnoType<decltype(xDelegate)>::get());
XComponentContext * pXComponentContext = NULL; XComponentContext * pXComponentContext = nullptr;
source_env.invoke(s_createComponentContext_v, mapped_entries.get(), nEntries, mapped_delegate, &pXComponentContext, &source2curr); source_env.invoke(s_createComponentContext_v, mapped_entries.get(), nEntries, mapped_delegate, &pXComponentContext, &source2curr);
mapped_entries.reset(); mapped_entries.reset();

View File

@@ -49,7 +49,7 @@ css::uno::Reference< css::uno::XComponentContext >
cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri) cppu::defaultBootstrap_InitialComponentContext(rtl::OUString const & iniUri)
{ {
rtl::Bootstrap bs(iniUri); rtl::Bootstrap bs(iniUri);
if (bs.getHandle() == 0) { if (bs.getHandle() == nullptr) {
throw css::uno::DeploymentException( throw css::uno::DeploymentException(
"Cannot open uno ini " + iniUri); "Cannot open uno ini " + iniUri);
} }

View File

@@ -89,29 +89,29 @@ static void SAL_CALL ExceptionThrower_dispatch(
if (rType_demanded.equals( cppu::UnoType<XInterface>::get() ) || if (rType_demanded.equals( cppu::UnoType<XInterface>::get() ) ||
rType_demanded.equals( ExceptionThrower::getCppuType() )) rType_demanded.equals( ExceptionThrower::getCppuType() ))
{ {
typelib_TypeDescription * pTD = 0; typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( &pTD, rType_demanded.getTypeLibType() ); TYPELIB_DANGER_GET( &pTD, rType_demanded.getTypeLibType() );
uno_any_construct( uno_any_construct(
static_cast< uno_Any * >( pReturn ), &pUnoI, pTD, 0 ); static_cast< uno_Any * >( pReturn ), &pUnoI, pTD, nullptr );
TYPELIB_DANGER_RELEASE( pTD ); TYPELIB_DANGER_RELEASE( pTD );
} }
else else
{ {
uno_any_construct( uno_any_construct(
static_cast< uno_Any * >( pReturn ), 0, 0, 0 ); static_cast< uno_Any * >( pReturn ), nullptr, nullptr, nullptr );
} }
*ppException = 0; *ppException = nullptr;
break; break;
} }
case 1: // acquire() case 1: // acquire()
case 2: // release() case 2: // release()
*ppException = 0; *ppException = nullptr;
break; break;
case 3: // throwException() case 3: // throwException()
{ {
uno_Any * pAny = static_cast< uno_Any * >( pArgs[ 0 ] ); uno_Any * pAny = static_cast< uno_Any * >( pArgs[ 0 ] );
OSL_ASSERT( pAny->pType->eTypeClass == typelib_TypeClass_EXCEPTION ); OSL_ASSERT( pAny->pType->eTypeClass == typelib_TypeClass_EXCEPTION );
uno_type_any_construct( *ppException, pAny->pData, pAny->pType, 0 ); uno_type_any_construct( *ppException, pAny->pData, pAny->pType, nullptr );
break; break;
} }
default: default:
@@ -119,7 +119,7 @@ static void SAL_CALL ExceptionThrower_dispatch(
OSL_ASSERT( false ); OSL_ASSERT( false );
RuntimeException exc( "not implemented!" ); RuntimeException exc( "not implemented!" );
uno_type_any_construct( uno_type_any_construct(
*ppException, &exc, cppu::UnoType<decltype(exc)>::get().getTypeLibType(), 0 ); *ppException, &exc, cppu::UnoType<decltype(exc)>::get().getTypeLibType(), nullptr );
break; break;
} }
} }
@@ -220,7 +220,7 @@ Any SAL_CALL getCaughtException()
"cannot get binary UNO to C++ mapping!" ); "cannot get binary UNO to C++ mapping!" );
} }
typelib_TypeDescription * pTD = 0; typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( TYPELIB_DANGER_GET(
&pTD, ExceptionThrower::getCppuType().getTypeLibType() ); &pTD, ExceptionThrower::getCppuType().getTypeLibType() );
@@ -230,7 +230,7 @@ Any SAL_CALL getCaughtException()
static_cast< XExceptionThrower * >( &theExceptionThrower::get() ), pTD ); static_cast< XExceptionThrower * >( &theExceptionThrower::get() ), pTD );
OSL_ASSERT( unoI.is() ); OSL_ASSERT( unoI.is() );
typelib_TypeDescription * pMemberTD = 0; typelib_TypeDescription * pMemberTD = nullptr;
TYPELIB_DANGER_GET( TYPELIB_DANGER_GET(
&pMemberTD, &pMemberTD,
reinterpret_cast< typelib_InterfaceTypeDescription * >( pTD )-> reinterpret_cast< typelib_InterfaceTypeDescription * >( pTD )->
@@ -238,12 +238,12 @@ Any SAL_CALL getCaughtException()
uno_Any exc_mem; uno_Any exc_mem;
uno_Any * exc = &exc_mem; uno_Any * exc = &exc_mem;
unoI.dispatch( pMemberTD, 0, 0, &exc ); unoI.dispatch( pMemberTD, nullptr, nullptr, &exc );
TYPELIB_DANGER_RELEASE( pMemberTD ); TYPELIB_DANGER_RELEASE( pMemberTD );
TYPELIB_DANGER_RELEASE( pTD ); TYPELIB_DANGER_RELEASE( pTD );
if (exc == 0) if (exc == nullptr)
{ {
throw RuntimeException( "rethrowing C++ exception failed!" ); throw RuntimeException( "rethrowing C++ exception failed!" );
} }
@@ -252,7 +252,7 @@ Any SAL_CALL getCaughtException()
uno_any_destruct( &ret, reinterpret_cast< uno_ReleaseFunc >(cpp_release) ); uno_any_destruct( &ret, reinterpret_cast< uno_ReleaseFunc >(cpp_release) );
uno_type_any_constructAndConvert( uno_type_any_constructAndConvert(
&ret, exc->pData, exc->pType, uno2cpp.get() ); &ret, exc->pData, exc->pType, uno2cpp.get() );
uno_any_destruct( exc, 0 ); uno_any_destruct( exc, nullptr );
return ret; return ret;
} }

View File

@@ -477,7 +477,7 @@ public:
const Reference<XRegistryKey > & xImplementationKey_, const Reference<XRegistryKey > & xImplementationKey_,
bool bOneInstance_ = false ) bool bOneInstance_ = false )
: OFactoryComponentHelper( : OFactoryComponentHelper(
rServiceManager, rImplementationName_, 0, 0, 0, bOneInstance_ ), rServiceManager, rImplementationName_, nullptr, nullptr, nullptr, bOneInstance_ ),
OPropertySetHelper( OComponentHelper::rBHelper ), OPropertySetHelper( OComponentHelper::rBHelper ),
xImplementationKey( xImplementationKey_ ) xImplementationKey( xImplementationKey_ )
{} {}
@@ -598,7 +598,7 @@ ORegistryFactoryHelper::getPropertySetInfo() throw (RuntimeException, std::excep
IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper() IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper()
{ {
::osl::MutexGuard guard( aMutex ); ::osl::MutexGuard guard( aMutex );
if (m_property_array_helper.get() == 0) if (m_property_array_helper.get() == nullptr)
{ {
beans::Property prop( beans::Property prop(
"ImplementationKey" /* name */, "ImplementationKey" /* name */,
@@ -960,7 +960,7 @@ Reference<XSingleServiceFactory > SAL_CALL createSingleFactory(
rtl_ModuleCount * ) rtl_ModuleCount * )
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, false ); rServiceManager, rImplementationName, pCreateFunction, nullptr, &rServiceNames, false );
} }
// global function // global function
@@ -980,7 +980,7 @@ Reference<XSingleServiceFactory > SAL_CALL createOneInstanceFactory(
rtl_ModuleCount * ) rtl_ModuleCount * )
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
rServiceManager, rImplementationName, pCreateFunction, 0, &rServiceNames, true ); rServiceManager, rImplementationName, pCreateFunction, nullptr, &rServiceNames, true );
} }
// global function // global function
@@ -1011,7 +1011,7 @@ Reference< lang::XSingleComponentFactory > SAL_CALL createSingleComponentFactory
rtl_ModuleCount *) rtl_ModuleCount *)
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, false ); Reference< XMultiServiceFactory >(), rImplementationName, nullptr, fptr, &rServiceNames, false );
} }
Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFactory( Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFactory(
@@ -1021,7 +1021,7 @@ Reference< lang::XSingleComponentFactory > SAL_CALL createOneInstanceComponentFa
rtl_ModuleCount *) rtl_ModuleCount *)
{ {
return new OFactoryComponentHelper( return new OFactoryComponentHelper(
Reference< XMultiServiceFactory >(), rImplementationName, 0, fptr, &rServiceNames, true ); Reference< XMultiServiceFactory >(), rImplementationName, nullptr, fptr, &rServiceNames, true );
} }
} }

View File

@@ -95,7 +95,7 @@ static inline type_entry * __getTypeEntries( class_data * cd )
for ( sal_Int32 n = cd->m_nTypes; n--; ) for ( sal_Int32 n = cd->m_nTypes; n--; )
{ {
type_entry * pEntry = &pEntries[ n ]; type_entry * pEntry = &pEntries[ n ];
Type const & rType = (*pEntry->m_type.getCppuType)( 0 ); Type const & rType = (*pEntry->m_type.getCppuType)( nullptr );
OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### wrong helper init: expected interface!" ); OSL_ENSURE( rType.getTypeClass() == TypeClass_INTERFACE, "### wrong helper init: expected interface!" );
OSL_ENSURE( ! isXInterface( rType.getTypeLibType()->pTypeName ), "### want to implement XInterface: template argument is XInterface?!?!?!" ); OSL_ENSURE( ! isXInterface( rType.getTypeLibType()->pTypeName ), "### want to implement XInterface: template argument is XInterface?!?!?!" );
if (rType.getTypeClass() != TypeClass_INTERFACE) if (rType.getTypeClass() != TypeClass_INTERFACE)
@@ -182,7 +182,7 @@ static inline void * __queryDeepNoXInterface(
// query deep getting td // query deep getting td
for ( n = 0; n < nTypes; ++n ) for ( n = 0; n < nTypes; ++n )
{ {
typelib_TypeDescription * pTD = 0; typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET( &pTD, pEntries[ n ].m_type.typeRef ); TYPELIB_DANGER_GET( &pTD, pEntries[ n ].m_type.typeRef );
if (pTD) if (pTD)
{ {
@@ -209,7 +209,7 @@ static inline void * __queryDeepNoXInterface(
throw RuntimeException( msg ); throw RuntimeException( msg );
} }
} }
return 0; return nullptr;
} }
// ImplHelper // ImplHelper

View File

@@ -65,7 +65,7 @@ void * component_getFactoryHelper(
SAL_UNUSED_PARAMETER void *, ImplementationEntry const * entries) SAL_UNUSED_PARAMETER void *, ImplementationEntry const * entries)
{ {
void * pRet = 0; void * pRet = nullptr;
Reference< XSingleComponentFactory > xFactory; Reference< XSingleComponentFactory > xFactory;
for( sal_Int32 i = 0 ; entries[i].create ; i ++ ) for( sal_Int32 i = 0 ; entries[i].create ; i ++ )

View File

@@ -127,7 +127,7 @@ XInterface * OInterfaceIteratorHelper::next()
return aData.pAsInterface; return aData.pAsInterface;
} }
// exception // exception
return 0; return nullptr;
} }
void OInterfaceIteratorHelper::remove() void OInterfaceIteratorHelper::remove()
@@ -285,7 +285,7 @@ sal_Int32 OInterfaceContainerHelper::removeInterface( const Reference<XInterface
else if( aData.pAsInterface && Reference<XInterface>( aData.pAsInterface ) == rListener ) else if( aData.pAsInterface && Reference<XInterface>( aData.pAsInterface ) == rListener )
{ {
aData.pAsInterface->release(); aData.pAsInterface->release();
aData.pAsInterface = 0; aData.pAsInterface = nullptr;
} }
return aData.pAsInterface ? 1 : 0; return aData.pAsInterface ? 1 : 0;
} }
@@ -299,7 +299,7 @@ void OInterfaceContainerHelper::disposeAndClear( const EventObject & rEvt )
if( !bIsList && aData.pAsInterface ) if( !bIsList && aData.pAsInterface )
aData.pAsInterface->release(); aData.pAsInterface->release();
// set the member to null, use the iterator to delete the values // set the member to null, use the iterator to delete the values
aData.pAsInterface = NULL; aData.pAsInterface = nullptr;
bIsList = sal_False; bIsList = sal_False;
bInUse = sal_False; bInUse = sal_False;
aGuard.clear(); aGuard.clear();
@@ -329,7 +329,7 @@ void OInterfaceContainerHelper::clear()
if( !bIsList && aData.pAsInterface ) if( !bIsList && aData.pAsInterface )
aData.pAsInterface->release(); aData.pAsInterface->release();
// set the member to null, use the iterator to delete the values // set the member to null, use the iterator to delete the values
aData.pAsInterface = 0; aData.pAsInterface = nullptr;
bIsList = sal_False; bIsList = sal_False;
bInUse = sal_False; bInUse = sal_False;
// release mutex before aIt destructor call // release mutex before aIt destructor call
@@ -355,7 +355,7 @@ OMultiTypeInterfaceContainerHelper::~OMultiTypeInterfaceContainerHelper()
while( iter != end ) while( iter != end )
{ {
delete static_cast<OInterfaceContainerHelper*>((*iter).second); delete static_cast<OInterfaceContainerHelper*>((*iter).second);
(*iter).second = 0; (*iter).second = nullptr;
++iter; ++iter;
} }
delete pMap; delete pMap;
@@ -416,7 +416,7 @@ OInterfaceContainerHelper * OMultiTypeInterfaceContainerHelper::getContainer( co
t_type2ptr::iterator iter = findType( pMap, rKey ); t_type2ptr::iterator iter = findType( pMap, rKey );
if( iter != pMap->end() ) if( iter != pMap->end() )
return static_cast<OInterfaceContainerHelper*>((*iter).second); return static_cast<OInterfaceContainerHelper*>((*iter).second);
return 0; return nullptr;
} }
sal_Int32 OMultiTypeInterfaceContainerHelper::addInterface( sal_Int32 OMultiTypeInterfaceContainerHelper::addInterface(
@@ -519,7 +519,7 @@ static t_long2ptr::iterator findLong(t_long2ptr *pMap, sal_Int32 nKey )
} }
OMultiTypeInterfaceContainerHelperInt32::OMultiTypeInterfaceContainerHelperInt32( Mutex & rMutex_ ) OMultiTypeInterfaceContainerHelperInt32::OMultiTypeInterfaceContainerHelperInt32( Mutex & rMutex_ )
: m_pMap( NULL ) : m_pMap( nullptr )
, rMutex( rMutex_ ) , rMutex( rMutex_ )
{ {
// delay pMap allocation until necessary. // delay pMap allocation until necessary.
@@ -537,7 +537,7 @@ OMultiTypeInterfaceContainerHelperInt32::~OMultiTypeInterfaceContainerHelperInt3
while( iter != end ) while( iter != end )
{ {
delete static_cast<OInterfaceContainerHelper*>((*iter).second); delete static_cast<OInterfaceContainerHelper*>((*iter).second);
(*iter).second = 0; (*iter).second = nullptr;
++iter; ++iter;
} }
delete pMap; delete pMap;
@@ -581,12 +581,12 @@ OInterfaceContainerHelper * OMultiTypeInterfaceContainerHelperInt32::getContaine
::osl::MutexGuard aGuard( rMutex ); ::osl::MutexGuard aGuard( rMutex );
if (!m_pMap) if (!m_pMap)
return 0; return nullptr;
t_long2ptr * pMap = static_cast<t_long2ptr *>(m_pMap); t_long2ptr * pMap = static_cast<t_long2ptr *>(m_pMap);
t_long2ptr::iterator iter = findLong( pMap, rKey ); t_long2ptr::iterator iter = findLong( pMap, rKey );
if( iter != pMap->end() ) if( iter != pMap->end() )
return static_cast<OInterfaceContainerHelper*>((*iter).second); return static_cast<OInterfaceContainerHelper*>((*iter).second);
return 0; return nullptr;
} }
sal_Int32 OMultiTypeInterfaceContainerHelperInt32::addInterface( sal_Int32 OMultiTypeInterfaceContainerHelperInt32::addInterface(

View File

@@ -51,7 +51,7 @@ namespace cppu
Bootstrap const & get_unorc() Bootstrap const & get_unorc()
{ {
static rtlBootstrapHandle s_bstrap = 0; static rtlBootstrapHandle s_bstrap = nullptr;
if (! s_bstrap) if (! s_bstrap)
{ {
OUString iniName(getUnoIniUri()); OUString iniName(getUnoIniUri());

View File

@@ -89,7 +89,7 @@ rtl::OUString cppu::getUnoIniUri() {
} }
bool cppu::nextDirectoryItem(osl::Directory & directory, rtl::OUString * url) { bool cppu::nextDirectoryItem(osl::Directory & directory, rtl::OUString * url) {
assert(url != 0); assert(url != nullptr);
for (;;) { for (;;) {
osl::DirectoryItem i; osl::DirectoryItem i;
switch (directory.getNextItem(i, SAL_MAX_UINT32)) { switch (directory.getNextItem(i, SAL_MAX_UINT32)) {
@@ -121,7 +121,7 @@ bool cppu::nextDirectoryItem(osl::Directory & directory, rtl::OUString * url) {
void cppu::decodeRdbUri(rtl::OUString * uri, bool * optional, bool * directory) void cppu::decodeRdbUri(rtl::OUString * uri, bool * optional, bool * directory)
{ {
assert(uri != 0 && optional != 0 && directory != 0); assert(uri != nullptr && optional != nullptr && directory != nullptr);
if(!(uri->isEmpty())) if(!(uri->isEmpty()))
{ {
*optional = (*uri)[0] == '?'; *optional = (*uri)[0] == '?';

View File

@@ -700,7 +700,7 @@ css::uno::Any PropertySetMixinImpl::Impl::getProperty(
"unexpected type of attribute " + name, object); "unexpected type of attribute " + name, object);
} }
} }
if (state != 0) { if (state != nullptr) {
//XXX If isAmbiguous && isDefaulted, arbitrarily choose AMBIGUOUS_VALUE //XXX If isAmbiguous && isDefaulted, arbitrarily choose AMBIGUOUS_VALUE
// over DEFAULT_VALUE: // over DEFAULT_VALUE:
*state = isAmbiguous *state = isAmbiguous
@@ -878,7 +878,7 @@ void PropertySetMixinImpl::prepareSet(
& css::beans::PropertyAttribute::BOUND) & css::beans::PropertyAttribute::BOUND)
!= 0) != 0)
{ {
assert(boundListeners != 0); assert(boundListeners != nullptr);
Impl::BoundListenerMap::const_iterator i( Impl::BoundListenerMap::const_iterator i(
m_impl->boundListeners.find(propertyName)); m_impl->boundListeners.find(propertyName));
if (i != m_impl->boundListeners.end()) { if (i != m_impl->boundListeners.end()) {
@@ -915,7 +915,7 @@ void PropertySetMixinImpl::prepareSet(
if ((it->second.property.Attributes & css::beans::PropertyAttribute::BOUND) if ((it->second.property.Attributes & css::beans::PropertyAttribute::BOUND)
!= 0) != 0)
{ {
assert(boundListeners != 0); assert(boundListeners != nullptr);
boundListeners->m_impl->event = css::beans::PropertyChangeEvent( boundListeners->m_impl->event = css::beans::PropertyChangeEvent(
static_cast< css::beans::XPropertySet * >(this), propertyName, static_cast< css::beans::XPropertySet * >(this), propertyName,
false, it->second.property.Handle, oldValue, newValue); false, it->second.property.Handle, oldValue, newValue);
@@ -1005,7 +1005,7 @@ css::uno::Any PropertySetMixinImpl::getPropertyValue(
css::uno::RuntimeException, std::exception) css::uno::RuntimeException, std::exception)
{ {
return m_impl->getProperty( return m_impl->getProperty(
static_cast< css::beans::XPropertySet * >(this), propertyName, 0); static_cast< css::beans::XPropertySet * >(this), propertyName, nullptr);
} }
void PropertySetMixinImpl::addPropertyChangeListener( void PropertySetMixinImpl::addPropertyChangeListener(
@@ -1120,7 +1120,7 @@ css::uno::Any PropertySetMixinImpl::getFastPropertyValue(sal_Int32 handle)
static_cast< css::beans::XPropertySet * >(this), static_cast< css::beans::XPropertySet * >(this),
m_impl->translateHandle( m_impl->translateHandle(
static_cast< css::beans::XPropertySet * >(this), handle), static_cast< css::beans::XPropertySet * >(this), handle),
0); nullptr);
} }
css::uno::Sequence< css::beans::PropertyValue > css::uno::Sequence< css::beans::PropertyValue >

View File

@@ -127,7 +127,7 @@ sal_Bool OPropertySetHelperInfo_Impl::hasPropertyByName( const OUString & Proper
pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(), pR = static_cast<Property *>(bsearch( &PropertyName, aInfos.getConstArray(), aInfos.getLength(),
sizeof( Property ), sizeof( Property ),
compare_OUString_Property_Impl )); compare_OUString_Property_Impl ));
return pR != NULL; return pR != nullptr;
} }
@@ -163,7 +163,7 @@ OPropertySetHelper::OPropertySetHelper(
: rBHelper( rBHelper_ ), : rBHelper( rBHelper_ ),
aBoundLC( rBHelper_.rMutex ), aBoundLC( rBHelper_.rMutex ),
aVetoableLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ),
m_pReserved( new Impl(false, 0) ) m_pReserved( new Impl(false, nullptr) )
{ {
} }
@@ -172,7 +172,7 @@ OPropertySetHelper::OPropertySetHelper(
: rBHelper( rBHelper_ ), : rBHelper( rBHelper_ ),
aBoundLC( rBHelper_.rMutex ), aBoundLC( rBHelper_.rMutex ),
aVetoableLC( rBHelper_.rMutex ), aVetoableLC( rBHelper_.rMutex ),
m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, 0 ) ) m_pReserved( new Impl( bIgnoreRuntimeExceptionsWhileFiring, nullptr ) )
{ {
} }
@@ -312,7 +312,7 @@ void OPropertySetHelper::addPropertyChangeListener(
} }
sal_Int16 nAttributes; sal_Int16 nAttributes;
rPH.fillPropertyMembersByHandle( NULL, &nAttributes, nHandle ); rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle );
if( !(nAttributes & css::beans::PropertyAttribute::BOUND) ) if( !(nAttributes & css::beans::PropertyAttribute::BOUND) )
{ {
OSL_FAIL( "add listener to an unbound property" ); OSL_FAIL( "add listener to an unbound property" );
@@ -394,7 +394,7 @@ void OPropertySetHelper::addVetoableChangeListener(
} }
sal_Int16 nAttributes; sal_Int16 nAttributes;
rPH.fillPropertyMembersByHandle( NULL, &nAttributes, nHandle ); rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle );
if( !(nAttributes & PropertyAttribute::CONSTRAINED) ) if( !(nAttributes & PropertyAttribute::CONSTRAINED) )
{ {
OSL_FAIL( "addVetoableChangeListener, and property is not constrained" ); OSL_FAIL( "addVetoableChangeListener, and property is not constrained" );
@@ -455,7 +455,7 @@ void OPropertySetHelper::setDependentFastPropertyValue( sal_Int32 i_handle, cons
sal_Int16 nAttributes(0); sal_Int16 nAttributes(0);
IPropertyArrayHelper& rInfo = getInfoHelper(); IPropertyArrayHelper& rInfo = getInfoHelper();
if ( !rInfo.fillPropertyMembersByHandle( NULL, &nAttributes, i_handle ) ) if ( !rInfo.fillPropertyMembersByHandle( nullptr, &nAttributes, i_handle ) )
// unknown property // unknown property
throw UnknownPropertyException(); throw UnknownPropertyException();
@@ -512,7 +512,7 @@ void OPropertySetHelper::setFastPropertyValue( sal_Int32 nHandle, const Any& rVa
IPropertyArrayHelper & rInfo = getInfoHelper(); IPropertyArrayHelper & rInfo = getInfoHelper();
sal_Int16 nAttributes; sal_Int16 nAttributes;
if( !rInfo.fillPropertyMembersByHandle( NULL, &nAttributes, nHandle ) ) { if( !rInfo.fillPropertyMembersByHandle( nullptr, &nAttributes, nHandle ) ) {
// unknown property // unknown property
throw UnknownPropertyException(); throw UnknownPropertyException();
} }
@@ -577,7 +577,7 @@ Any OPropertySetHelper::getFastPropertyValue( sal_Int32 nHandle )
{ {
IPropertyArrayHelper & rInfo = getInfoHelper(); IPropertyArrayHelper & rInfo = getInfoHelper();
if( !rInfo.fillPropertyMembersByHandle( NULL, NULL, nHandle ) ) if( !rInfo.fillPropertyMembersByHandle( nullptr, nullptr, nHandle ) )
// unknown property // unknown property
throw UnknownPropertyException(); throw UnknownPropertyException();
@@ -786,7 +786,7 @@ void OPropertySetHelper::fire
if( !bVetoable ) if( !bVetoable )
{ {
OInterfaceContainerHelper * pCont = 0; OInterfaceContainerHelper * pCont = nullptr;
pCont = rBHelper.aLC.getContainer( pCont = rBHelper.aLC.getContainer(
getPropertiesTypeIdentifier( ) getPropertiesTypeIdentifier( )
); );
@@ -854,7 +854,7 @@ void OPropertySetHelper::setFastPropertyValues(
if( pHandles[i] != -1 ) if( pHandles[i] != -1 )
{ {
sal_Int16 nAttributes; sal_Int16 nAttributes;
rPH.fillPropertyMembersByHandle( NULL, &nAttributes, pHandles[i] ); rPH.fillPropertyMembersByHandle( nullptr, &nAttributes, pHandles[i] );
if( nAttributes & PropertyAttribute::READONLY ) { if( nAttributes & PropertyAttribute::READONLY ) {
throw PropertyVetoException(); throw PropertyVetoException();
} }
@@ -1042,7 +1042,7 @@ OPropertyArrayHelper::OPropertyArrayHelper(
Property * pProps, Property * pProps,
sal_Int32 nEle, sal_Int32 nEle,
sal_Bool bSorted ) sal_Bool bSorted )
: m_pReserved(NULL) : m_pReserved(nullptr)
, aInfos(pProps, nEle) , aInfos(pProps, nEle)
, bRightOrdered( sal_False ) , bRightOrdered( sal_False )
{ {
@@ -1052,7 +1052,7 @@ OPropertyArrayHelper::OPropertyArrayHelper(
OPropertyArrayHelper::OPropertyArrayHelper( OPropertyArrayHelper::OPropertyArrayHelper(
const Sequence< Property > & aProps, const Sequence< Property > & aProps,
sal_Bool bSorted ) sal_Bool bSorted )
: m_pReserved(NULL) : m_pReserved(nullptr)
, aInfos(aProps) , aInfos(aProps)
, bRightOrdered( sal_False ) , bRightOrdered( sal_False )
{ {
@@ -1131,7 +1131,7 @@ sal_Bool OPropertyArrayHelper::hasPropertyByName(const OUString& aPropertyName)
pR = static_cast<Property *>(bsearch( &aPropertyName, aInfos.getConstArray(), aInfos.getLength(), pR = static_cast<Property *>(bsearch( &aPropertyName, aInfos.getConstArray(), aInfos.getLength(),
sizeof( Property ), sizeof( Property ),
compare_OUString_Property_Impl )); compare_OUString_Property_Impl ));
return pR != NULL; return pR != nullptr;
} }

View File

@@ -59,7 +59,7 @@ void insertImplementationMap(
cppuhelper::ServiceManager::Data::ImplementationMap * destination, cppuhelper::ServiceManager::Data::ImplementationMap * destination,
cppuhelper::ServiceManager::Data::ImplementationMap const & source) cppuhelper::ServiceManager::Data::ImplementationMap const & source)
{ {
assert(destination != 0); assert(destination != nullptr);
for (cppuhelper::ServiceManager::Data::ImplementationMap::const_iterator i( for (cppuhelper::ServiceManager::Data::ImplementationMap::const_iterator i(
source.begin()); source.begin());
i != source.end(); ++i) i != source.end(); ++i)
@@ -80,7 +80,7 @@ void removeFromImplementationMap(
{ {
// The underlying data structures make this function somewhat inefficient, // The underlying data structures make this function somewhat inefficient,
// but the assumption is that it is rarely called: // but the assumption is that it is rarely called:
assert(map != 0); assert(map != nullptr);
for (std::vector< rtl::OUString >::const_iterator i(elements.begin()); for (std::vector< rtl::OUString >::const_iterator i(elements.begin());
i != elements.end(); ++i) i != elements.end(); ++i)
{ {
@@ -137,7 +137,7 @@ Parser::Parser(
cppuhelper::ServiceManager::Data * data): cppuhelper::ServiceManager::Data * data):
reader_(uri), alienContext_(alienContext), data_(data) reader_(uri), alienContext_(alienContext), data_(data)
{ {
assert(data != 0); assert(data != nullptr);
int ucNsId = reader_.registerNamespaceIri( int ucNsId = reader_.registerNamespaceIri(
xmlreader::Span( xmlreader::Span(
RTL_CONSTASCII_STRINGPARAM( RTL_CONSTASCII_STRINGPARAM(
@@ -497,7 +497,7 @@ public:
cppuhelper::ServiceManager::Data::Implementation > const & cppuhelper::ServiceManager::Data::Implementation > const &
implementation): implementation):
manager_(manager), implementation_(implementation) manager_(manager), implementation_(implementation)
{ assert(manager.is()); assert(implementation.get() != 0); } { assert(manager.is()); assert(implementation.get() != nullptr); }
private: private:
virtual ~SingletonFactory() {} virtual ~SingletonFactory() {}
@@ -551,7 +551,7 @@ public:
cppuhelper::ServiceManager::Data::Implementation > const & cppuhelper::ServiceManager::Data::Implementation > const &
implementation): implementation):
manager_(manager), implementation_(implementation) manager_(manager), implementation_(implementation)
{ assert(manager.is()); assert(implementation.get() != 0); } { assert(manager.is()); assert(implementation.get() != nullptr); }
private: private:
virtual ~ImplementationWrapper() {} virtual ~ImplementationWrapper() {}
@@ -677,7 +677,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstance(
bool singletonRequest) bool singletonRequest)
{ {
css::uno::Reference<css::uno::XInterface> inst; css::uno::Reference<css::uno::XInterface> inst;
if (constructor != 0) { if (constructor != nullptr) {
inst.set( inst.set(
(*constructor)(context.get(), css::uno::Sequence<css::uno::Any>()), (*constructor)(context.get(), css::uno::Sequence<css::uno::Any>()),
SAL_NO_ACQUIRE); SAL_NO_ACQUIRE);
@@ -697,7 +697,7 @@ cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
bool singletonRequest, css::uno::Sequence<css::uno::Any> const & arguments) bool singletonRequest, css::uno::Sequence<css::uno::Any> const & arguments)
{ {
css::uno::Reference<css::uno::XInterface> inst; css::uno::Reference<css::uno::XInterface> inst;
if (constructor != 0) { if (constructor != nullptr) {
inst.set((*constructor)(context.get(), arguments), SAL_NO_ACQUIRE); inst.set((*constructor)(context.get(), arguments), SAL_NO_ACQUIRE);
//HACK: The constructor will either observe arguments and return inst //HACK: The constructor will either observe arguments and return inst
// that does not implement XInitialization (or null), or ignore // that does not implement XInitialization (or null), or ignore
@@ -749,12 +749,12 @@ void cppuhelper::ServiceManager::Data::Implementation::updateDisposeSingleton(
void cppuhelper::ServiceManager::addSingletonContextEntries( void cppuhelper::ServiceManager::addSingletonContextEntries(
std::vector< cppu::ContextEntry_Init > * entries) std::vector< cppu::ContextEntry_Init > * entries)
{ {
assert(entries != 0); assert(entries != nullptr);
for (Data::ImplementationMap::const_iterator i(data_.singletons.begin()); for (Data::ImplementationMap::const_iterator i(data_.singletons.begin());
i != data_.singletons.end(); ++i) i != data_.singletons.end(); ++i)
{ {
assert(!i->second.empty()); assert(!i->second.empty());
assert(i->second[0].get() != 0); assert(i->second[0].get() != nullptr);
SAL_INFO_IF( SAL_INFO_IF(
i->second.size() > 1, "cppuhelper", i->second.size() > 1, "cppuhelper",
"Arbitrarily chosing " << i->second[0]->info->name "Arbitrarily chosing " << i->second[0]->info->name
@@ -773,7 +773,7 @@ void cppuhelper::ServiceManager::loadImplementation(
css::uno::Reference< css::uno::XComponentContext > const & context, css::uno::Reference< css::uno::XComponentContext > const & context,
std::shared_ptr< Data::Implementation > & implementation) std::shared_ptr< Data::Implementation > & implementation)
{ {
assert(implementation.get() != 0); assert(implementation.get() != nullptr);
{ {
osl::MutexGuard g(rBHelper.rMutex); osl::MutexGuard g(rBHelper.rMutex);
if (implementation->status == Data::Implementation::STATUS_LOADED) { if (implementation->status == Data::Implementation::STATUS_LOADED) {
@@ -788,7 +788,7 @@ void cppuhelper::ServiceManager::loadImplementation(
"Cannot expand URI" + implementation->info->uri + ": " + e.Message, "Cannot expand URI" + implementation->info->uri + ": " + e.Message,
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
cppuhelper::ImplementationConstructorFn * ctor = 0; cppuhelper::ImplementationConstructorFn * ctor = nullptr;
css::uno::Reference< css::uno::XInterface > f0; css::uno::Reference< css::uno::XInterface > f0;
// Special handling of SharedLibrary loader, with support for environment, // Special handling of SharedLibrary loader, with support for environment,
// constructor, and prefix arguments: // constructor, and prefix arguments:
@@ -799,7 +799,7 @@ void cppuhelper::ServiceManager::loadImplementation(
uri, implementation->info->environment, uri, implementation->info->environment,
implementation->info->prefix, implementation->info->name, implementation->info->prefix, implementation->info->name,
implementation->info->constructor, this, &ctor, &f0); implementation->info->constructor, this, &ctor, &f0);
if (ctor != 0) { if (ctor != nullptr) {
assert(!implementation->info->environment.isEmpty()); assert(!implementation->info->environment.isEmpty());
css::uno::Environment curEnv(css::uno::Environment::getCurrent()); css::uno::Environment curEnv(css::uno::Environment::getCurrent());
css::uno::Environment env( css::uno::Environment env(
@@ -849,7 +849,7 @@ void cppuhelper::ServiceManager::loadImplementation(
} }
css::uno::Reference<css::lang::XSingleComponentFactory> f1; css::uno::Reference<css::lang::XSingleComponentFactory> f1;
css::uno::Reference<css::lang::XSingleServiceFactory> f2; css::uno::Reference<css::lang::XSingleServiceFactory> f2;
if (ctor == 0) { if (ctor == nullptr) {
f1.set(f0, css::uno::UNO_QUERY); f1.set(f0, css::uno::UNO_QUERY);
if (!f1.is()) { if (!f1.is()) {
f2.set(f0, css::uno::UNO_QUERY); f2.set(f0, css::uno::UNO_QUERY);
@@ -885,7 +885,7 @@ void cppuhelper::ServiceManager::disposing() {
data_.namedImplementations.begin()); data_.namedImplementations.begin());
i != data_.namedImplementations.end(); ++i) i != data_.namedImplementations.end(); ++i)
{ {
assert(i->second.get() != 0); assert(i->second.get() != nullptr);
if (!i->second->info->singletons.empty()) { if (!i->second->info->singletons.empty()) {
osl::MutexGuard g2(i->second->mutex); osl::MutexGuard g2(i->second->mutex);
if (i->second->disposeSingleton.is()) { if (i->second->disposeSingleton.is()) {
@@ -897,7 +897,7 @@ void cppuhelper::ServiceManager::disposing() {
data_.dynamicImplementations.begin()); data_.dynamicImplementations.begin());
i != data_.dynamicImplementations.end(); ++i) i != data_.dynamicImplementations.end(); ++i)
{ {
assert(i->second.get() != 0); assert(i->second.get() != nullptr);
if (!i->second->info->singletons.empty()) { if (!i->second->info->singletons.empty()) {
osl::MutexGuard g2(i->second->mutex); osl::MutexGuard g2(i->second->mutex);
if (i->second->disposeSingleton.is()) { if (i->second->disposeSingleton.is()) {
@@ -1013,7 +1013,7 @@ cppuhelper::ServiceManager::createInstanceWithContext(
{ {
std::shared_ptr< Data::Implementation > impl( std::shared_ptr< Data::Implementation > impl(
findServiceImplementation(Context, aServiceSpecifier)); findServiceImplementation(Context, aServiceSpecifier));
return impl.get() == 0 return impl.get() == nullptr
? css::uno::Reference< css::uno::XInterface >() ? css::uno::Reference< css::uno::XInterface >()
: impl->createInstance(Context, false); : impl->createInstance(Context, false);
} }
@@ -1027,7 +1027,7 @@ cppuhelper::ServiceManager::createInstanceWithArgumentsAndContext(
{ {
std::shared_ptr< Data::Implementation > impl( std::shared_ptr< Data::Implementation > impl(
findServiceImplementation(Context, ServiceSpecifier)); findServiceImplementation(Context, ServiceSpecifier));
return impl.get() == 0 return impl.get() == nullptr
? css::uno::Reference< css::uno::XInterface >() ? css::uno::Reference< css::uno::XInterface >()
: impl->createInstanceWithArguments(Context, false, Arguments); : impl->createInstanceWithArguments(Context, false, Arguments);
} }
@@ -1196,7 +1196,7 @@ cppuhelper::ServiceManager::createContentEnumeration(
i != impls.end(); ++i) i != impls.end(); ++i)
{ {
Data::Implementation * impl = i->get(); Data::Implementation * impl = i->get();
assert(impl != 0); assert(impl != nullptr);
{ {
osl::MutexGuard g(rBHelper.rMutex); osl::MutexGuard g(rBHelper.rMutex);
if (isDisposed()) { if (isDisposed()) {
@@ -1562,7 +1562,7 @@ void cppuhelper::ServiceManager::readLegacyRdbStrings(
rtl::OUString const & uri, RegistryKey & key, rtl::OUString const & path, rtl::OUString const & uri, RegistryKey & key, rtl::OUString const & path,
std::vector< rtl::OUString > * strings) std::vector< rtl::OUString > * strings)
{ {
assert(strings != 0); assert(strings != nullptr);
RegistryKey subkey; RegistryKey subkey;
switch (key.openKey(path, subkey)) { switch (key.openKey(path, subkey)) {
case RegError::NO_ERROR: case RegError::NO_ERROR:
@@ -1705,7 +1705,7 @@ bool cppuhelper::ServiceManager::insertExtraData(Data const & extra) {
cont->removeByName(name + "/arguments"); cont->removeByName(name + "/arguments");
} catch (const css::container::NoSuchElementException &) {} } catch (const css::container::NoSuchElementException &) {}
assert(!i->second.empty()); assert(!i->second.empty());
assert(i->second[0].get() != 0); assert(i->second[0].get() != nullptr);
SAL_INFO_IF( SAL_INFO_IF(
i->second.size() > 1, "cppuhelper", i->second.size() > 1, "cppuhelper",
"Arbitrarily chosing " << i->second[0]->info->name "Arbitrarily chosing " << i->second[0]->info->name
@@ -1745,7 +1745,7 @@ void cppuhelper::ServiceManager::removeRdbFiles(
data_.namedImplementations.begin()); data_.namedImplementations.begin());
j != data_.namedImplementations.end();) j != data_.namedImplementations.end();)
{ {
assert(j->second.get() != 0); assert(j->second.get() != nullptr);
if (j->second->info->rdbFile == *i) { if (j->second->info->rdbFile == *i) {
clear.push_back(j->second); clear.push_back(j->second);
//TODO: The below leaves data_ in an inconsistent state upon //TODO: The below leaves data_ in an inconsistent state upon
@@ -1779,7 +1779,7 @@ bool cppuhelper::ServiceManager::removeLegacyFactory(
if (i == data_.dynamicImplementations.end()) { if (i == data_.dynamicImplementations.end()) {
return isDisposed(); return isDisposed();
} }
assert(i->second.get() != 0); assert(i->second.get() != nullptr);
clear = i->second; clear = i->second;
if (removeListener) { if (removeListener) {
comp = i->second->component; comp = i->second->component;
@@ -1816,7 +1816,7 @@ void cppuhelper::ServiceManager::removeImplementation(const rtl::OUString & name
"Remove non-inserted implementation " + name, "Remove non-inserted implementation " + name,
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
assert(i->second.get() != 0); assert(i->second.get() != nullptr);
clear = i->second; clear = i->second;
//TODO: The below leaves data_ in an inconsistent state upon exceptions: //TODO: The below leaves data_ in an inconsistent state upon exceptions:
removeFromImplementationMap( removeFromImplementationMap(
@@ -1863,7 +1863,7 @@ cppuhelper::ServiceManager::findServiceImplementation(
<< " among multiple implementations for " << i->first); << " among multiple implementations for " << i->first);
impl = i->second[0]; impl = i->second[0];
} }
assert(impl.get() != 0); assert(impl.get() != nullptr);
loaded = impl->status == Data::Implementation::STATUS_LOADED; loaded = impl->status == Data::Implementation::STATUS_LOADED;
} }
if (!loaded) { if (!loaded) {

View File

@@ -108,7 +108,7 @@ public:
new ImplementationInfo( new ImplementationInfo(
name, loader, uri, environment, constructorName, prefix, name, loader, uri, environment, constructorName, prefix,
alienContext, rdbFile)), alienContext, rdbFile)),
constructor(0), status(STATUS_NEW), dispose(true) constructor(nullptr), status(STATUS_NEW), dispose(true)
{} {}
Implementation( Implementation(
@@ -119,7 +119,7 @@ public:
theFactory2, theFactory2,
css::uno::Reference< css::lang::XComponent > const & css::uno::Reference< css::lang::XComponent > const &
theComponent): theComponent):
info(new ImplementationInfo(name)), constructor(0), info(new ImplementationInfo(name)), constructor(nullptr),
factory1(theFactory1), factory2(theFactory2), factory1(theFactory1), factory2(theFactory2),
component(theComponent), status(STATUS_LOADED), dispose(true) component(theComponent), status(STATUS_LOADED), dispose(true)
{ assert(theFactory1.is() || theFactory2.is()); } { assert(theFactory1.is() || theFactory2.is()); }

View File

@@ -43,7 +43,7 @@ css::uno::Environment cppuhelper::detail::getEnvironment(
assert(!implementation.isEmpty()); assert(!implementation.isEmpty());
rtl::OUString n(name); rtl::OUString n(name);
static char const * log = std::getenv("UNO_ENV_LOG"); static char const * log = std::getenv("UNO_ENV_LOG");
if (log != 0 && *log != 0) { if (log != nullptr && *log != 0) {
rtl::OString imps(log); rtl::OString imps(log);
for (sal_Int32 i = 0; i != -1;) { for (sal_Int32 i = 0; i != -1;) {
rtl::OString imp(imps.getToken(0, ';', i)); rtl::OString imp(imps.getToken(0, ';', i));
@@ -65,7 +65,7 @@ css::uno::Environment getEnvironmentFromModule(
osl::Module const & module, css::uno::Environment const & target, osl::Module const & module, css::uno::Environment const & target,
rtl::OUString const & implementation, rtl::OUString const & prefix) rtl::OUString const & implementation, rtl::OUString const & prefix)
{ {
char const * name = 0; char const * name = nullptr;
css::uno::Environment env; css::uno::Environment env;
rtl::OUString fullPrefix(prefix); rtl::OUString fullPrefix(prefix);
if (!fullPrefix.isEmpty()) { if (!fullPrefix.isEmpty()) {
@@ -74,7 +74,7 @@ css::uno::Environment getEnvironmentFromModule(
component_getImplementationEnvironmentExtFunc fp1 component_getImplementationEnvironmentExtFunc fp1
= reinterpret_cast<component_getImplementationEnvironmentExtFunc>( = reinterpret_cast<component_getImplementationEnvironmentExtFunc>(
module.getFunctionSymbol(fullPrefix + COMPONENT_GETENVEXT)); module.getFunctionSymbol(fullPrefix + COMPONENT_GETENVEXT));
if (fp1 != 0) { if (fp1 != nullptr) {
(*fp1)( (*fp1)(
&name, reinterpret_cast<uno_Environment **>(&env), &name, reinterpret_cast<uno_Environment **>(&env),
(rtl::OUStringToOString(implementation, RTL_TEXTENCODING_ASCII_US) (rtl::OUStringToOString(implementation, RTL_TEXTENCODING_ASCII_US)
@@ -84,13 +84,13 @@ css::uno::Environment getEnvironmentFromModule(
component_getImplementationEnvironmentFunc fp2 component_getImplementationEnvironmentFunc fp2
= reinterpret_cast<component_getImplementationEnvironmentFunc>( = reinterpret_cast<component_getImplementationEnvironmentFunc>(
module.getFunctionSymbol(fullPrefix + COMPONENT_GETENV)); module.getFunctionSymbol(fullPrefix + COMPONENT_GETENV));
if (fp2 != 0) { if (fp2 != nullptr) {
(*fp2)(&name, reinterpret_cast<uno_Environment **>(&env)); (*fp2)(&name, reinterpret_cast<uno_Environment **>(&env));
} else { } else {
name = CPPU_CURRENT_LANGUAGE_BINDING_NAME; //TODO: fail name = CPPU_CURRENT_LANGUAGE_BINDING_NAME; //TODO: fail
} }
} }
if (!env.is() && name != 0) { if (!env.is() && name != nullptr) {
env = cppuhelper::detail::getEnvironment( env = cppuhelper::detail::getEnvironment(
rtl::OUString::createFromAscii(name), implementation); rtl::OUString::createFromAscii(name), implementation);
} }
@@ -124,7 +124,7 @@ css::uno::Reference<css::uno::XInterface> invokeComponentFactory(
if (source.get() == target.get()) { if (source.get() == target.get()) {
return css::uno::Reference<css::uno::XInterface>( return css::uno::Reference<css::uno::XInterface>(
static_cast<css::uno::XInterface *>( static_cast<css::uno::XInterface *>(
(*function)(impl.getStr(), serviceManager.get(), 0)), (*function)(impl.getStr(), serviceManager.get(), nullptr)),
SAL_NO_ACQUIRE); SAL_NO_ACQUIRE);
} else { } else {
css::uno::Mapping mapTo(source, target); css::uno::Mapping mapTo(source, target);
@@ -137,13 +137,13 @@ css::uno::Reference<css::uno::XInterface> invokeComponentFactory(
void * smgr = mapTo.mapInterface( void * smgr = mapTo.mapInterface(
serviceManager.get(), serviceManager.get(),
cppu::UnoType<css::lang::XMultiServiceFactory>::get()); cppu::UnoType<css::lang::XMultiServiceFactory>::get());
void * factory = 0; void * factory = nullptr;
target.invoke(getFactory, function, &impl, smgr, 0, &factory); target.invoke(getFactory, function, &impl, smgr, 0, &factory);
if (smgr != 0) { if (smgr != nullptr) {
(*target.get()->pExtEnv->releaseInterface)( (*target.get()->pExtEnv->releaseInterface)(
target.get()->pExtEnv, smgr); target.get()->pExtEnv, smgr);
} }
if (factory == 0) { if (factory == nullptr) {
throw css::loader::CannotActivateFactoryException( throw css::loader::CannotActivateFactoryException(
("calling factory function for \"" + implementation + "\" in <" ("calling factory function for \"" + implementation + "\" in <"
+ uri + "> returned null"), + uri + "> returned null"),
@@ -171,9 +171,9 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
{ {
assert(constructor.isEmpty() || !environment.isEmpty()); assert(constructor.isEmpty() || !environment.isEmpty());
assert( assert(
(constructorFunction == 0 && constructor.isEmpty()) (constructorFunction == nullptr && constructor.isEmpty())
|| *constructorFunction == 0); || *constructorFunction == nullptr);
assert(factory != 0 && !factory->is()); assert(factory != nullptr && !factory->is());
#if defined DISABLE_DYNLOADING #if defined DISABLE_DYNLOADING
assert(!environment.isEmpty()); assert(!environment.isEmpty());
if (constructor.isEmpty()) { if (constructor.isEmpty()) {
@@ -249,7 +249,7 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
sym = COMPONENT_GETFACTORY; sym = COMPONENT_GETFACTORY;
} }
oslGenericFunction fp = mod.getFunctionSymbol(sym); oslGenericFunction fp = mod.getFunctionSymbol(sym);
if (fp == 0) { if (fp == nullptr) {
throw css::loader::CannotActivateFactoryException( throw css::loader::CannotActivateFactoryException(
("no factory symbol \"" + sym + "\" in component library <" ("no factory symbol \"" + sym + "\" in component library <"
+ uri + ">"), + uri + ">"),
@@ -266,7 +266,7 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
} else { } else {
SAL_INFO("cppuhelper.shlib", "constructor=" << constructor); SAL_INFO("cppuhelper.shlib", "constructor=" << constructor);
oslGenericFunction fp = mod.getFunctionSymbol(constructor); oslGenericFunction fp = mod.getFunctionSymbol(constructor);
if (fp == 0) { if (fp == nullptr) {
throw css::loader::CannotActivateFactoryException( throw css::loader::CannotActivateFactoryException(
("no constructor symbol \"" + constructor ("no constructor symbol \"" + constructor
+ "\" in component library <" + uri + ">"), + "\" in component library <" + uri + ">"),
@@ -289,7 +289,7 @@ css::uno::Reference<css::uno::XInterface> cppu::loadSharedLibComponentFactory(
assert(!xKey.is()); (void) xKey; assert(!xKey.is()); (void) xKey;
css::uno::Reference<css::uno::XInterface> fac; css::uno::Reference<css::uno::XInterface> fac;
cppuhelper::detail::loadSharedLibComponentFactory( cppuhelper::detail::loadSharedLibComponentFactory(
uri, "", "", rImplName, "", xMgr, 0, &fac); uri, "", "", rImplName, "", xMgr, nullptr, &fac);
return fac; return fac;
} }
@@ -320,7 +320,7 @@ void cppu::writeSharedLibComponentInfo(
css::uno::Reference<css::uno::XInterface>()); css::uno::Reference<css::uno::XInterface>());
} }
oslGenericFunction fp = mod.getFunctionSymbol(COMPONENT_WRITEINFO); oslGenericFunction fp = mod.getFunctionSymbol(COMPONENT_WRITEINFO);
if (fp == 0) { if (fp == nullptr) {
throw css::registry::CannotRegisterImplementationException( throw css::registry::CannotRegisterImplementationException(
("no symbol \"" COMPONENT_WRITEINFO "\" in component library <" ("no symbol \"" COMPONENT_WRITEINFO "\" in component library <"
+ uri + ">"), + uri + ">"),
@@ -345,7 +345,7 @@ void cppu::writeSharedLibComponentInfo(
sal_Bool ok; sal_Bool ok;
env.invoke(writeInfo, fp, smgr, key, &ok); env.invoke(writeInfo, fp, smgr, key, &ok);
(*env.get()->pExtEnv->releaseInterface)(env.get()->pExtEnv, key); (*env.get()->pExtEnv->releaseInterface)(env.get()->pExtEnv, key);
if (smgr != 0) { if (smgr != nullptr) {
(*env.get()->pExtEnv->releaseInterface)(env.get()->pExtEnv, smgr); (*env.get()->pExtEnv->releaseInterface)(env.get()->pExtEnv, smgr);
} }
if (!ok) { if (!ok) {

View File

@@ -20,7 +20,7 @@
bool cppu::supportsService( bool cppu::supportsService(
css::lang::XServiceInfo * implementation, rtl::OUString const & name) css::lang::XServiceInfo * implementation, rtl::OUString const & name)
{ {
assert(implementation != 0); assert(implementation != nullptr);
css::uno::Sequence< rtl::OUString > s( css::uno::Sequence< rtl::OUString > s(
implementation->getSupportedServiceNames()); implementation->getSupportedServiceNames());
for (sal_Int32 i = 0; i != s.getLength(); ++i) { for (sal_Int32 i = 0; i != s.getLength(); ++i) {

View File

@@ -68,7 +68,7 @@ static typelib_TypeDescription * createCTD(
inline static typelib_TypeDescription * createCTD( inline static typelib_TypeDescription * createCTD(
const Reference< XCompoundTypeDescription > & xType ) const Reference< XCompoundTypeDescription > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is()) if (xType.is())
{ {
typelib_TypeDescription * pBaseType = createCTD( typelib_TypeDescription * pBaseType = createCTD(
@@ -108,7 +108,7 @@ inline static typelib_TypeDescription * createCTD(
&pRet, &pRet,
(typelib_TypeClass)xType->getTypeClass(), (typelib_TypeClass)xType->getTypeClass(),
aTypeName.pData, aTypeName.pData,
(pBaseType ? pBaseType->pWeakRef : 0), (pBaseType ? pBaseType->pWeakRef : nullptr),
nMembers, pMemberInits ); nMembers, pMemberInits );
// cleanup // cleanup
@@ -126,7 +126,7 @@ inline static typelib_TypeDescription * createCTD(
Reference< container::XHierarchicalNameAccess > const & access, Reference< container::XHierarchicalNameAccess > const & access,
const Reference< XStructTypeDescription > & xType ) const Reference< XStructTypeDescription > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is() && xType->getTypeParameters().getLength() == 0) if (xType.is() && xType->getTypeParameters().getLength() == 0)
{ {
typelib_TypeDescription * pBaseType = createCTD( typelib_TypeDescription * pBaseType = createCTD(
@@ -184,7 +184,7 @@ inline static typelib_TypeDescription * createCTD(
typelib_typedescription_newStruct( typelib_typedescription_newStruct(
&pRet, &pRet,
aTypeName.pData, aTypeName.pData,
(pBaseType ? pBaseType->pWeakRef : 0), (pBaseType ? pBaseType->pWeakRef : nullptr),
nMembers, pMemberInits ); nMembers, pMemberInits );
// cleanup // cleanup
@@ -201,7 +201,7 @@ inline static typelib_TypeDescription * createCTD(
inline static typelib_TypeDescription * createCTD( inline static typelib_TypeDescription * createCTD(
const Reference< XInterfaceAttributeTypeDescription2 > & xAttribute ) const Reference< XInterfaceAttributeTypeDescription2 > & xAttribute )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xAttribute.is()) if (xAttribute.is())
{ {
OUString aMemberName( xAttribute->getName() ); OUString aMemberName( xAttribute->getName() );
@@ -239,7 +239,7 @@ inline static typelib_TypeDescription * createCTD(
static typelib_TypeDescription * createCTD( static typelib_TypeDescription * createCTD(
const Reference< XInterfaceMethodTypeDescription > & xMethod ) const Reference< XInterfaceMethodTypeDescription > & xMethod )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xMethod.is()) if (xMethod.is())
{ {
Reference< XTypeDescription > xReturnType( xMethod->getReturnType() ); Reference< XTypeDescription > xReturnType( xMethod->getReturnType() );
@@ -311,7 +311,7 @@ inline static typelib_TypeDescription * createCTD(
Reference< container::XHierarchicalNameAccess > const & access, Reference< container::XHierarchicalNameAccess > const & access,
const Reference< XInterfaceTypeDescription2 > & xType ) const Reference< XInterfaceTypeDescription2 > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is()) if (xType.is())
{ {
Sequence< Reference< XTypeDescription > > aBases(xType->getBaseTypes()); Sequence< Reference< XTypeDescription > > aBases(xType->getBaseTypes());
@@ -346,7 +346,7 @@ inline static typelib_TypeDescription * createCTD(
for ( nPos = nMembers; nPos--; ) for ( nPos = nMembers; nPos--; )
{ {
OUString aMemberTypeName( pMembers[nPos]->getName() ); OUString aMemberTypeName( pMembers[nPos]->getName() );
ppMemberRefs[nPos] = 0; ppMemberRefs[nPos] = nullptr;
typelib_typedescriptionreference_new( typelib_typedescriptionreference_new(
ppMemberRefs + nPos, ppMemberRefs + nPos,
(typelib_TypeClass)pMembers[nPos]->getTypeClass(), (typelib_TypeClass)pMembers[nPos]->getTypeClass(),
@@ -375,7 +375,7 @@ inline static typelib_TypeDescription * createCTD(
inline static typelib_TypeDescription * createCTD( const Reference< XEnumTypeDescription > & xType ) inline static typelib_TypeDescription * createCTD( const Reference< XEnumTypeDescription > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is()) if (xType.is())
{ {
OUString aTypeName( xType->getName() ); OUString aTypeName( xType->getName() );
@@ -396,7 +396,7 @@ inline static typelib_TypeDescription * createCTD(
Reference< container::XHierarchicalNameAccess > const & access, Reference< container::XHierarchicalNameAccess > const & access,
const Reference< XIndirectTypeDescription > & xType ) const Reference< XIndirectTypeDescription > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is()) if (xType.is())
{ {
typelib_TypeDescription * pRefType = createCTD( typelib_TypeDescription * pRefType = createCTD(
@@ -410,7 +410,7 @@ inline static typelib_TypeDescription * createCTD(
(typelib_TypeClass)xType->getTypeClass(), (typelib_TypeClass)xType->getTypeClass(),
aTypeName.pData, aTypeName.pData,
pRefType->pWeakRef, pRefType->pWeakRef,
0, 0 ); 0, nullptr );
// cleanup // cleanup
typelib_typedescription_release( pRefType ); typelib_typedescription_release( pRefType );
@@ -423,7 +423,7 @@ static typelib_TypeDescription * createCTD(
Reference< container::XHierarchicalNameAccess > const & access, Reference< container::XHierarchicalNameAccess > const & access,
const Reference< XTypeDescription > & xType ) const Reference< XTypeDescription > & xType )
{ {
typelib_TypeDescription * pRet = 0; typelib_TypeDescription * pRet = nullptr;
if (xType.is()) if (xType.is())
{ {
@@ -433,91 +433,91 @@ static typelib_TypeDescription * createCTD(
case TypeClass_VOID: case TypeClass_VOID:
{ {
OUString aTypeName("void"); OUString aTypeName("void");
typelib_typedescription_new( &pRet, typelib_TypeClass_VOID, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_VOID, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_CHAR: case TypeClass_CHAR:
{ {
OUString aTypeName("char"); OUString aTypeName("char");
typelib_typedescription_new( &pRet, typelib_TypeClass_CHAR, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_CHAR, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_BOOLEAN: case TypeClass_BOOLEAN:
{ {
OUString aTypeName("boolean"); OUString aTypeName("boolean");
typelib_typedescription_new( &pRet, typelib_TypeClass_BOOLEAN, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_BOOLEAN, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_BYTE: case TypeClass_BYTE:
{ {
OUString aTypeName("byte"); OUString aTypeName("byte");
typelib_typedescription_new( &pRet, typelib_TypeClass_BYTE, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_BYTE, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_SHORT: case TypeClass_SHORT:
{ {
OUString aTypeName("short"); OUString aTypeName("short");
typelib_typedescription_new( &pRet, typelib_TypeClass_SHORT, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_SHORT, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_UNSIGNED_SHORT: case TypeClass_UNSIGNED_SHORT:
{ {
OUString aTypeName("unsigned short"); OUString aTypeName("unsigned short");
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_SHORT, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_SHORT, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_LONG: case TypeClass_LONG:
{ {
OUString aTypeName("long"); OUString aTypeName("long");
typelib_typedescription_new( &pRet, typelib_TypeClass_LONG, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_LONG, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_UNSIGNED_LONG: case TypeClass_UNSIGNED_LONG:
{ {
OUString aTypeName("unsigned long"); OUString aTypeName("unsigned long");
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_LONG, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_LONG, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_HYPER: case TypeClass_HYPER:
{ {
OUString aTypeName("hyper"); OUString aTypeName("hyper");
typelib_typedescription_new( &pRet, typelib_TypeClass_HYPER, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_HYPER, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_UNSIGNED_HYPER: case TypeClass_UNSIGNED_HYPER:
{ {
OUString aTypeName("unsigned hyper"); OUString aTypeName("unsigned hyper");
typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_HYPER, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_UNSIGNED_HYPER, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_FLOAT: case TypeClass_FLOAT:
{ {
OUString aTypeName("float"); OUString aTypeName("float");
typelib_typedescription_new( &pRet, typelib_TypeClass_FLOAT, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_FLOAT, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_DOUBLE: case TypeClass_DOUBLE:
{ {
OUString aTypeName("double"); OUString aTypeName("double");
typelib_typedescription_new( &pRet, typelib_TypeClass_DOUBLE, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_DOUBLE, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_STRING: case TypeClass_STRING:
{ {
OUString aTypeName("string"); OUString aTypeName("string");
typelib_typedescription_new( &pRet, typelib_TypeClass_STRING, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_STRING, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_TYPE: case TypeClass_TYPE:
{ {
OUString aTypeName("type"); OUString aTypeName("type");
typelib_typedescription_new( &pRet, typelib_TypeClass_TYPE, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_TYPE, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
case TypeClass_ANY: case TypeClass_ANY:
{ {
OUString aTypeName("any"); OUString aTypeName("any");
typelib_typedescription_new( &pRet, typelib_TypeClass_ANY, aTypeName.pData, 0, 0, 0 ); typelib_typedescription_new( &pRet, typelib_TypeClass_ANY, aTypeName.pData, nullptr, 0, nullptr );
break; break;
} }
@@ -574,7 +574,7 @@ static void SAL_CALL typelib_callback(
if (*ppRet) if (*ppRet)
{ {
::typelib_typedescription_release( *ppRet ); ::typelib_typedescription_release( *ppRet );
*ppRet = 0; *ppRet = nullptr;
} }
if (pContext && pTypeName) if (pContext && pTypeName)
{ {

View File

@@ -42,7 +42,7 @@ Sequence< sal_Int8 > OImplementationId::getImplementationId() const
if (! _pSeq) if (! _pSeq)
{ {
Sequence< sal_Int8 > * pSeq = new Sequence< sal_Int8 >( 16 ); Sequence< sal_Int8 > * pSeq = new Sequence< sal_Int8 >( 16 );
::rtl_createUuid( reinterpret_cast<sal_uInt8 *>(pSeq->getArray()), 0, _bUseEthernetAddress ); ::rtl_createUuid( reinterpret_cast<sal_uInt8 *>(pSeq->getArray()), nullptr, _bUseEthernetAddress );
_pSeq = pSeq; _pSeq = pSeq;
} }
} }

View File

@@ -36,7 +36,7 @@ namespace cppu
// due to static Reflection destruction from usr, there must be a mutex leak (#73272#) // due to static Reflection destruction from usr, there must be a mutex leak (#73272#)
inline static Mutex & getWeakMutex() inline static Mutex & getWeakMutex()
{ {
static Mutex * s_pMutex = 0; static Mutex * s_pMutex = nullptr;
if (! s_pMutex) if (! s_pMutex)
s_pMutex = new Mutex(); s_pMutex = new Mutex();
return *s_pMutex; return *s_pMutex;
@@ -209,9 +209,9 @@ void SAL_CALL OWeakObject::release() throw()
void OWeakObject::disposeWeakConnectionPoint() void OWeakObject::disposeWeakConnectionPoint()
{ {
OSL_PRECOND( m_refCount == 0, "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" ); OSL_PRECOND( m_refCount == 0, "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" );
if (m_pWeakConnectionPoint != 0) { if (m_pWeakConnectionPoint != nullptr) {
OWeakConnectionPoint * const p = m_pWeakConnectionPoint; OWeakConnectionPoint * const p = m_pWeakConnectionPoint;
m_pWeakConnectionPoint = 0; m_pWeakConnectionPoint = nullptr;
try { try {
p->dispose(); p->dispose();
} }
@@ -412,7 +412,7 @@ void SAL_CALL OWeakRefListener::dispose()
//-- WeakReferenceHelper ---------------------------------------------------------- //-- WeakReferenceHelper ----------------------------------------------------------
WeakReferenceHelper::WeakReferenceHelper(const Reference< XInterface >& xInt) WeakReferenceHelper::WeakReferenceHelper(const Reference< XInterface >& xInt)
: m_pImpl( 0 ) : m_pImpl( nullptr )
{ {
if (xInt.is()) if (xInt.is())
{ {
@@ -422,7 +422,7 @@ WeakReferenceHelper::WeakReferenceHelper(const Reference< XInterface >& xInt)
} }
WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef) WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef)
: m_pImpl( 0 ) : m_pImpl( nullptr )
{ {
Reference< XInterface > xInt( rWeakRef.get() ); Reference< XInterface > xInt( rWeakRef.get() );
if (xInt.is()) if (xInt.is())
@@ -445,7 +445,7 @@ void WeakReferenceHelper::clear()
m_pImpl->m_XWeakConnectionPoint.clear(); m_pImpl->m_XWeakConnectionPoint.clear();
} }
m_pImpl->release(); m_pImpl->release();
m_pImpl = 0; m_pImpl = nullptr;
} }
} }
catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no unexpected() catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no unexpected()

View File

@@ -138,7 +138,7 @@ SAL_CALL createSingleComponentFactory(
ComponentFactoryFunc fptr, ComponentFactoryFunc fptr,
::rtl::OUString const & rImplementationName, ::rtl::OUString const & rImplementationName,
css::uno::Sequence< ::rtl::OUString > const & rServiceNames, css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
rtl_ModuleCount * pModCount = 0 ); rtl_ModuleCount * pModCount = NULL );
/** Creates a single service factory which holds the instance created only once. /** Creates a single service factory which holds the instance created only once.
@@ -155,7 +155,7 @@ createOneInstanceComponentFactory(
ComponentFactoryFunc fptr, ComponentFactoryFunc fptr,
::rtl::OUString const & rImplementationName, ::rtl::OUString const & rImplementationName,
css::uno::Sequence< ::rtl::OUString > const & rServiceNames, css::uno::Sequence< ::rtl::OUString > const & rServiceNames,
rtl_ModuleCount * pModCount = 0 ); rtl_ModuleCount * pModCount = NULL );
/** Deprecated. The type of the instanciate function used as argument of the create*Factory functions. /** Deprecated. The type of the instanciate function used as argument of the create*Factory functions.
@@ -186,7 +186,7 @@ createSingleFactory(
const ::rtl::OUString & rImplementationName, const ::rtl::OUString & rImplementationName,
ComponentInstantiation pCreateFunction, ComponentInstantiation pCreateFunction,
const css::uno::Sequence< ::rtl::OUString > & rServiceNames, const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
rtl_ModuleCount * pModCount = 0 ); rtl_ModuleCount * pModCount = NULL );
/** Deprecated. Creates a factory wrapping another one. /** Deprecated. Creates a factory wrapping another one.
This means the methods of the interfaces XServiceProvider, XServiceInfo and This means the methods of the interfaces XServiceProvider, XServiceInfo and
@@ -227,7 +227,7 @@ createOneInstanceFactory(
const ::rtl::OUString & rComponentName, const ::rtl::OUString & rComponentName,
ComponentInstantiation pCreateFunction, ComponentInstantiation pCreateFunction,
const css::uno::Sequence< ::rtl::OUString > & rServiceNames, const css::uno::Sequence< ::rtl::OUString > & rServiceNames,
rtl_ModuleCount * pModCount = 0 ); rtl_ModuleCount * pModCount = NULL );
/** Deprecated. Creates a single service factory based on a registry. /** Deprecated. Creates a single service factory based on a registry.

View File

@@ -49,7 +49,7 @@ namespace detail {
{ {
css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > *pAsSequence; css::uno::Sequence< css::uno::Reference< css::uno::XInterface > > *pAsSequence;
css::uno::XInterface * pAsInterface; css::uno::XInterface * pAsInterface;
element_alias() : pAsInterface(0) {} element_alias() : pAsInterface(NULL) {}
}; };
} }

View File

@@ -90,7 +90,7 @@ OInterfaceContainerHelper * OMultiTypeInterfaceContainerHelperVar< key , hashImp
typename InterfaceMap::iterator iter = find( rKey ); typename InterfaceMap::iterator iter = find( rKey );
if( iter != m_pMap->end() ) if( iter != m_pMap->end() )
return static_cast<OInterfaceContainerHelper*>( (*iter).second ); return static_cast<OInterfaceContainerHelper*>( (*iter).second );
return 0; return NULL;
} }

View File

@@ -191,7 +191,7 @@ public:
@param bUseEthernetAddress whether an ethernet mac address should be taken into account @param bUseEthernetAddress whether an ethernet mac address should be taken into account
*/ */
inline OImplementationId( bool bUseEthernetAddress = true ) inline OImplementationId( bool bUseEthernetAddress = true )
: _pSeq( 0 ) : _pSeq( NULL )
, _bUseEthernetAddress( bUseEthernetAddress ) , _bUseEthernetAddress( bUseEthernetAddress )
{} {}
/** Constructor giving implementation id. /** Constructor giving implementation id.

View File

@@ -100,8 +100,8 @@ public:
*/ */
inline OWeakObject() inline OWeakObject()
: m_refCount( 0 ) : m_refCount( 0 )
, m_pWeakConnectionPoint( 0 ) , m_pWeakConnectionPoint( NULL )
, m_pReserved(0) , m_pReserved(NULL)
{} {}
#endif #endif
/** Dummy copy constructor. Set the reference count to zero. /** Dummy copy constructor. Set the reference count to zero.
@@ -111,8 +111,8 @@ public:
inline OWeakObject( const OWeakObject & rObj ) inline OWeakObject( const OWeakObject & rObj )
: css::uno::XWeak() : css::uno::XWeak()
, m_refCount( 0 ) , m_refCount( 0 )
, m_pWeakConnectionPoint( 0 ) , m_pWeakConnectionPoint( NULL )
, m_pReserved(0) , m_pReserved(NULL)
{ {
(void) rObj; (void) rObj;
} }
@@ -170,7 +170,7 @@ public:
*/ */
static inline css::uno::XInterface * acquire(OWeakObject * instance) static inline css::uno::XInterface * acquire(OWeakObject * instance)
{ {
assert(instance != 0); assert(instance != NULL);
instance->acquire(); instance->acquire();
return instance; return instance;
} }

View File

@@ -44,7 +44,7 @@ public:
/** Default ctor. Creates an empty weak reference. /** Default ctor. Creates an empty weak reference.
*/ */
inline WeakReferenceHelper() inline WeakReferenceHelper()
: m_pImpl( 0 ) : m_pImpl( NULL )
{} {}
/** Copy ctor. Initialize this reference with the same interface as in rWeakRef. /** Copy ctor. Initialize this reference with the same interface as in rWeakRef.