From 85a2ec80c65dbcc7c031d21f584d0417f66f2164 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 8 Jun 2015 16:24:22 +0200 Subject: loplugin:cstylecast: deal with remaining pointer casts Change-Id: I4eea017d429945cdd8636c0f06cb18f5887a0d78 --- cppuhelper/source/component.cxx | 4 ++-- cppuhelper/source/propshlp.cxx | 4 ++-- cppuhelper/source/weak.cxx | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'cppuhelper') diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index ec154f855476..dd5bf47f3762 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -168,7 +168,7 @@ void OComponentHelper::dispose() try { Reference xSource( - Reference::query( (XComponent *)this ) ); + Reference::query( static_cast(this) ) ); EventObject aEvt; aEvt.Source = xSource; // inform all listeners to release this object @@ -218,7 +218,7 @@ void OComponentHelper::addEventListener( if (rBHelper.bDisposed || rBHelper.bInDispose) { aGuard.clear(); - Reference< XInterface > x( (XComponent *)this, UNO_QUERY ); + Reference< XInterface > x( static_cast(this), UNO_QUERY ); rxListener->disposing( EventObject( x ) ); } else diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index 5be08741b499..153a92139865 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -648,7 +648,7 @@ void OPropertySetHelper::fire // create the event sequence of all changed properties Sequence< PropertyChangeEvent > aEvts( nHandles ); PropertyChangeEvent * pEvts = aEvts.getArray(); - Reference < XInterface > xSource( (XPropertySet *)this, UNO_QUERY ); + Reference < XInterface > xSource( static_cast(this), UNO_QUERY ); sal_Int32 i; sal_Int32 nChangesLen = 0; // Loop over all changed properties to fill the event struct @@ -975,7 +975,7 @@ void OPropertySetHelper::firePropertiesChangeEvent( { // must lock the mutex outside the loop. So all values are consistent. MutexGuard aGuard( rBHelper.rMutex ); - Reference < XInterface > xSource( (XPropertySet *)this, UNO_QUERY ); + Reference < XInterface > xSource( static_cast(this), UNO_QUERY ); sal_Int32 nFirePos = 0; for( i = 0; i < nLen; i++ ) { diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index deb3a2b64743..7532955ad4e6 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -350,7 +350,7 @@ OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt) if (m_XWeakConnectionPoint.is()) { - m_XWeakConnectionPoint->addReference((XReference*)this); + m_XWeakConnectionPoint->addReference(static_cast(this)); } } } @@ -365,7 +365,7 @@ OWeakRefListener::~OWeakRefListener() if (m_XWeakConnectionPoint.is()) { acquire(); // dont die again - m_XWeakConnectionPoint->removeReference((XReference*)this); + m_XWeakConnectionPoint->removeReference(static_cast(this)); } } catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no unexpected() @@ -405,7 +405,7 @@ void SAL_CALL OWeakRefListener::dispose() } if( xAdp.is() ) - xAdp->removeReference((XReference*)this); + xAdp->removeReference(static_cast(this)); } @@ -441,7 +441,7 @@ void WeakReferenceHelper::clear() if (m_pImpl->m_XWeakConnectionPoint.is()) { m_pImpl->m_XWeakConnectionPoint->removeReference( - (XReference*)m_pImpl); + static_cast(m_pImpl)); m_pImpl->m_XWeakConnectionPoint.clear(); } m_pImpl->release(); -- cgit