loplugin:nullptr (automatic rewrite)

Change-Id: I8be8b75317f0a8cf9005feefea05c053b76c7b0f
This commit is contained in:
Stephan Bergmann
2015-11-10 10:31:14 +01:00
parent 7ab1fb2972
commit 3bf5bc0374
8 changed files with 30 additions and 30 deletions
@@ -76,15 +76,15 @@ Sequence< Type > SAL_CALL BaseContainerControl::getTypes() throw( RuntimeExcepti
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection ( cppu::UnoType<XControlModel>::get(),
+8 -8
View File
@@ -40,7 +40,7 @@ using namespace ::com::sun::star::awt;
namespace unocontrols{
#define DEFAULT_PMULTIPLEXER NULL
#define DEFAULT_PMULTIPLEXER nullptr
#define DEFAULT_X 0
#define DEFAULT_Y 0
#define DEFAULT_WIDTH 100
@@ -119,15 +119,15 @@ Sequence< Type > SAL_CALL BaseControl::getTypes() throw( RuntimeException, std::
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection( cppu::UnoType<XPaintListener>::get(),
@@ -220,7 +220,7 @@ void SAL_CALL BaseControl::dispose() throw( RuntimeException, std::exception )
// Ready for multithreading
MutexGuard aGuard( m_aMutex );
if ( m_pMultiplexer != NULL )
if ( m_pMultiplexer != nullptr )
{
// to all other paint, focus, etc.
m_pMultiplexer->disposeAndClear();
@@ -292,7 +292,7 @@ void SAL_CALL BaseControl::createPeer( const Reference< XToolkit >& xToo
if ( m_xPeerWindow.is() )
{
if ( m_pMultiplexer != NULL )
if ( m_pMultiplexer != nullptr )
{
m_pMultiplexer->setPeer( m_xPeerWindow );
}
@@ -773,7 +773,7 @@ void BaseControl::impl_releasePeer()
m_xPeerWindow.clear();
m_xPeer.clear();
if ( m_pMultiplexer != NULL )
if ( m_pMultiplexer != nullptr )
{
// take changes on multiplexer
m_pMultiplexer->setPeer( Reference< XWindow >() );
@@ -785,7 +785,7 @@ void BaseControl::impl_releasePeer()
OMRCListenerMultiplexerHelper* BaseControl::impl_getMultiplexer()
{
if ( m_pMultiplexer == NULL )
if ( m_pMultiplexer == nullptr )
{
m_pMultiplexer = new OMRCListenerMultiplexerHelper( static_cast<XWindow*>(this), m_xPeerWindow );
m_xMultiplexer.set( static_cast<OWeakObject*>(m_pMultiplexer), UNO_QUERY );
+1 -1
View File
@@ -37,7 +37,7 @@ namespace unocontrols{
/* First get all interfaces from container with right type.*/ \
OInterfaceContainerHelper* pContainer = m_aListenerHolder.getContainer( cppu::UnoType<INTERFACE>::get() ); \
/* Do the follow only, if elements in container exist.*/ \
if( pContainer != NULL ) \
if( pContainer != nullptr ) \
{ \
OInterfaceIteratorHelper aIterator( *pContainer ); \
EVENTTYP aLocalEvent = EVENT; \
@@ -197,7 +197,7 @@ Sequence< Reference< XInterface > > SAL_CALL OConnectionPointHelper::getConnecti
// Get pointer to specialized container which hold all interfaces of searched type.
OInterfaceContainerHelper* pSpecialContainer = aSharedContainer.getContainer( m_aInterfaceType );
// Get elements of searched type, if some else exist.
if ( pSpecialContainer != NULL )
if ( pSpecialContainer != nullptr )
{
seqReturnConnections = pSpecialContainer->getElements();
}
+3 -3
View File
@@ -111,15 +111,15 @@ Sequence< Type > SAL_CALL FrameControl::getTypes() throw( RuntimeException, std:
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection ( cppu::UnoType<XControlModel>::get(),
+3 -3
View File
@@ -109,15 +109,15 @@ Sequence< Type > SAL_CALL ProgressBar::getTypes() throw( RuntimeException, std::
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection ( cppu::UnoType<XControlModel>::get(),
@@ -150,15 +150,15 @@ Sequence< Type > SAL_CALL ProgressMonitor::getTypes() throw( RuntimeException, s
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection ( cppu::UnoType<XLayoutConstrains>::get(),
@@ -206,10 +206,10 @@ void SAL_CALL ProgressMonitor::addText(
// Safe impossible cases
// Check valid call of this method.
DBG_ASSERT ( impl_debug_checkParameter ( rTopic, rText, bbeforeProgress ) , "ProgressMonitor::addText()\nCall without valid parameters!\n");
DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != NULL ) , "ProgresMonitor::addText()\nThe text already exist.\n" );
DBG_ASSERT ( !(impl_searchTopic ( rTopic, bbeforeProgress ) != nullptr ) , "ProgresMonitor::addText()\nThe text already exist.\n" );
// Do nothing (in Release), if topic already exist.
if ( impl_searchTopic ( rTopic, bbeforeProgress ) != NULL )
if ( impl_searchTopic ( rTopic, bbeforeProgress ) != nullptr )
{
return;
}
@@ -249,7 +249,7 @@ void SAL_CALL ProgressMonitor::removeText ( const OUString& rTopic, sal_Bool bbe
// Search the topic ...
IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress );
if ( pSearchItem != NULL )
if ( pSearchItem != nullptr )
{
// Ready for multithreading
MutexGuard aGuard ( m_aMutex );
@@ -292,7 +292,7 @@ void SAL_CALL ProgressMonitor::updateText (
// Search topic ...
IMPL_TextlistItem* pSearchItem = impl_searchTopic ( rTopic, bbeforeProgress );
if ( pSearchItem != NULL )
if ( pSearchItem != nullptr )
{
// Ready for multithreading
MutexGuard aGuard ( m_aMutex );
@@ -865,7 +865,7 @@ IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, b
}
// We haven't found this topic... return a nonvalid pointer.
return NULL;
return nullptr;
}
// debug methods
@@ -118,15 +118,15 @@ Sequence< Type > SAL_CALL StatusIndicator::getTypes() throw( RuntimeException, s
// Optimize this method !
// We initialize a static variable only one time. And we don't must use a mutex at every call!
// For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
static OTypeCollection* pTypeCollection = NULL;
static OTypeCollection* pTypeCollection = nullptr;
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Ready for multithreading; get global mutex for first call of this method only! see before
MutexGuard aGuard( Mutex::getGlobalMutex() );
// Control these pointer again ... it can be, that another instance will be faster then these!
if ( pTypeCollection == NULL )
if ( pTypeCollection == nullptr )
{
// Create a static typecollection ...
static OTypeCollection aTypeCollection ( cppu::UnoType<XLayoutConstrains>::get(),