summaryrefslogtreecommitdiff
path: root/UnoControls
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-11 09:06:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-11 09:58:36 +0000
commit556373c41fddbac6cbee1c89e7707631270a1852 (patch)
tree026862690693419beb8810fdc6671ae30c72a026 /UnoControls
parent62b124b2704adf11a63681164d05a8eb49dfb105 (diff)
V668 no sense in testing the result of new against null
Change-Id: I4a33bd92fc8448638a4bfe1eab7e5041a4c5cc39
Diffstat (limited to 'UnoControls')
-rw-r--r--UnoControls/source/base/basecontainercontrol.cxx65
-rw-r--r--UnoControls/source/controls/progressmonitor.cxx29
2 files changed, 44 insertions, 50 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);
}
}
}
diff --git a/UnoControls/source/controls/progressmonitor.cxx b/UnoControls/source/controls/progressmonitor.cxx
index a2f19c350da3..e752b006031e 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -217,24 +217,21 @@ void SAL_CALL ProgressMonitor::addText(
// Else ... take memory for new item ...
IMPL_TextlistItem* pTextItem = new IMPL_TextlistItem;
- if ( pTextItem != NULL )
- {
- // Set values ...
- pTextItem->sTopic = rTopic;
- pTextItem->sText = rText;
+ // Set values ...
+ pTextItem->sTopic = rTopic;
+ pTextItem->sText = rText;
- // Ready for multithreading
- MutexGuard aGuard ( m_aMutex );
+ // Ready for multithreading
+ MutexGuard aGuard ( m_aMutex );
- // ... and insert it in right list.
- if ( bbeforeProgress )
- {
- maTextlist_Top.push_back( pTextItem );
- }
- else
- {
- maTextlist_Bottom.push_back( pTextItem );
- }
+ // ... and insert it in right list.
+ if ( bbeforeProgress )
+ {
+ maTextlist_Top.push_back( pTextItem );
+ }
+ else
+ {
+ maTextlist_Bottom.push_back( pTextItem );
}
// ... update window