summaryrefslogtreecommitdiff
path: root/eventattacher
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-02-11 09:02:13 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-02-12 09:04:54 +0100
commitcfbd830e9c4d1877989bc4ad93109551a0a4b0b7 (patch)
treea050319e1167c816ac284894de0c2d4a535ee23a /eventattacher
parent294b9a415929f25982373e91cba9254686074b19 (diff)
tdf#120703 PVS: remove redundant static casts
V572 It is odd that the object which was created using 'new' operator is immediately cast to another type. Change-Id: I5fee1c4bebd1972fbb5e43da37149d4e2ff6ce0d Reviewed-on: https://gerrit.libreoffice.org/67664 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'eventattacher')
-rw-r--r--eventattacher/source/eventattacher.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 09d51b4843dd..2711dd28a01a 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -96,7 +96,7 @@ static Reference< XInterface > createAllListenerAdapter
if( xInvocationAdapterFactory.is() && xListenerType.is() && xListener.is() )
{
Reference< XInvocation > xInvocationToAllListenerMapper =
- static_cast<XInvocation*>(new InvocationToAllListenerMapper( xListenerType, xListener, Helper ));
+ new InvocationToAllListenerMapper(xListenerType, xListener, Helper);
Type aListenerType( xListenerType->getTypeClass(), xListenerType->getName());
Sequence<Type> arg2(1);
arg2[0] = aListenerType;
@@ -278,7 +278,7 @@ EventAttacherImpl::EventAttacherImpl( const Reference< XComponentContext >& rxCo
/// @throws Exception
static Reference< XInterface > EventAttacherImpl_CreateInstance( const Reference< XMultiServiceFactory >& rSMgr )
{
- XEventAttacher *pEventAttacher = static_cast<XEventAttacher*>(new EventAttacherImpl( comphelper::getComponentContext(rSMgr) ));
+ XEventAttacher* pEventAttacher = new EventAttacherImpl(comphelper::getComponentContext(rSMgr));
Reference< XInterface > xRet(pEventAttacher, UNO_QUERY);
@@ -730,8 +730,8 @@ Reference< XEventListener > EventAttacherImpl::attachSingleEventListener
)
{
// Subscribe FilterListener
- Reference< XAllListener > aFilterListener = static_cast<XAllListener*>(
- new FilterAllListenerImpl( this, EventMethod, AllListener ));
+ Reference<XAllListener> aFilterListener
+ = new FilterAllListenerImpl(this, EventMethod, AllListener);
return attachListener( xObject, aFilterListener, Helper, ListenerType, AddListenerParam);
}
@@ -846,8 +846,8 @@ Sequence< Reference<XEventListener> > EventAttacherImpl::attachMultipleEventList
Sequence< Reference<XAllListener> > aFilterListeners(nCount);
for (sal_Int32 i = 0; i < nCount; ++i)
{
- aFilterListeners[i] = static_cast<XAllListener*>(
- new FilterAllListenerImpl(this, aListeners[i].EventMethod, aListeners[i].AllListener));
+ aFilterListeners[i]
+ = new FilterAllListenerImpl(this, aListeners[i].EventMethod, aListeners[i].AllListener);
}
return attachListeners(xObject, aFilterListeners, aListeners);