diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 09:06:08 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-11 09:58:36 +0000 |
commit | 556373c41fddbac6cbee1c89e7707631270a1852 (patch) | |
tree | 026862690693419beb8810fdc6671ae30c72a026 /UnoControls/source/base | |
parent | 62b124b2704adf11a63681164d05a8eb49dfb105 (diff) |
V668 no sense in testing the result of new against null
Change-Id: I4a33bd92fc8448638a4bfe1eab7e5041a4c5cc39
Diffstat (limited to 'UnoControls/source/base')
-rw-r--r-- | UnoControls/source/base/basecontainercontrol.cxx | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/UnoControls/source/base/basecontainercontrol.cxx b/UnoControls/source/base/basecontainercontrol.cxx index 829ae6bb12ee..7c8e5e0e67e7 100644 --- a/UnoControls/source/base/basecontainercontrol.cxx +++ b/UnoControls/source/base/basecontainercontrol.cxx @@ -225,49 +225,46 @@ void SAL_CALL BaseContainerControl::addControl ( const OUString& rName, const Re // take memory for new item IMPL_ControlInfo* pNewControl = new IMPL_ControlInfo; - if (pNewControl!=(IMPL_ControlInfo*)0) - { - // Ready for multithreading - MutexGuard aGuard (m_aMutex); + // Ready for multithreading + MutexGuard aGuard (m_aMutex); - // set control - pNewControl->sName = rName; - pNewControl->xControl = rControl; + // set control + pNewControl->sName = rName; + pNewControl->xControl = rControl; - // and insert in list - maControlInfoList.push_back( pNewControl ); + // and insert in list + maControlInfoList.push_back( pNewControl ); - // initialize new control - pNewControl->xControl->setContext ( (OWeakObject*)this ); - pNewControl->xControl->addEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) ); + // initialize new control + pNewControl->xControl->setContext ( (OWeakObject*)this ); + pNewControl->xControl->addEventListener ( static_cast< XEventListener* >( static_cast< XWindowListener* >( this ) ) ); - // when container has a peer ... - if (getPeer().is()) - { - // .. then create a peer on child - pNewControl->xControl->createPeer ( getPeer()->getToolkit(), getPeer() ); - impl_activateTabControllers (); - } + // when container has a peer ... + if (getPeer().is()) + { + // .. then create a peer on child + pNewControl->xControl->createPeer ( getPeer()->getToolkit(), getPeer() ); + impl_activateTabControllers (); + } - // Send message to all listener - OInterfaceContainerHelper* pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get()); + // Send message to all listener + OInterfaceContainerHelper* pInterfaceContainer = m_aListeners.getContainer( cppu::UnoType<XContainerListener>::get()); - if (pInterfaceContainer) - { - // Build event - ContainerEvent aEvent; + if (pInterfaceContainer) + { + // Build event + ContainerEvent aEvent; - aEvent.Source = *this; - aEvent.Element <<= rControl; + aEvent.Source = *this; + aEvent.Element <<= rControl; - // Get all listener - OInterfaceIteratorHelper aIterator (*pInterfaceContainer); + // Get all listener + OInterfaceIteratorHelper aIterator (*pInterfaceContainer); - // Send event - while ( aIterator.hasMoreElements() ) - { - static_cast<XContainerListener*>(aIterator.next())->elementInserted (aEvent); - } + // Send event + while ( aIterator.hasMoreElements() ) + { + static_cast<XContainerListener*>(aIterator.next())->elementInserted (aEvent); } } } |