loplugin:cstylecast: deal with remaining pointer casts

Change-Id: I4eea017d429945cdd8636c0f06cb18f5887a0d78
This commit is contained in:
Stephan Bergmann
2015-06-08 16:24:22 +02:00
parent cd14c53664
commit 85a2ec80c6
3 changed files with 8 additions and 8 deletions

View File

@@ -168,7 +168,7 @@ void OComponentHelper::dispose()
try try
{ {
Reference<XInterface > xSource( Reference<XInterface > xSource(
Reference<XInterface >::query( (XComponent *)this ) ); Reference<XInterface >::query( static_cast<XComponent *>(this) ) );
EventObject aEvt; EventObject aEvt;
aEvt.Source = xSource; aEvt.Source = xSource;
// inform all listeners to release this object // inform all listeners to release this object
@@ -218,7 +218,7 @@ void OComponentHelper::addEventListener(
if (rBHelper.bDisposed || rBHelper.bInDispose) if (rBHelper.bDisposed || rBHelper.bInDispose)
{ {
aGuard.clear(); aGuard.clear();
Reference< XInterface > x( (XComponent *)this, UNO_QUERY ); Reference< XInterface > x( static_cast<XComponent *>(this), UNO_QUERY );
rxListener->disposing( EventObject( x ) ); rxListener->disposing( EventObject( x ) );
} }
else else

View File

@@ -648,7 +648,7 @@ void OPropertySetHelper::fire
// create the event sequence of all changed properties // create the event sequence of all changed properties
Sequence< PropertyChangeEvent > aEvts( nHandles ); Sequence< PropertyChangeEvent > aEvts( nHandles );
PropertyChangeEvent * pEvts = aEvts.getArray(); PropertyChangeEvent * pEvts = aEvts.getArray();
Reference < XInterface > xSource( (XPropertySet *)this, UNO_QUERY ); Reference < XInterface > xSource( static_cast<XPropertySet *>(this), UNO_QUERY );
sal_Int32 i; sal_Int32 i;
sal_Int32 nChangesLen = 0; sal_Int32 nChangesLen = 0;
// Loop over all changed properties to fill the event struct // 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. // must lock the mutex outside the loop. So all values are consistent.
MutexGuard aGuard( rBHelper.rMutex ); MutexGuard aGuard( rBHelper.rMutex );
Reference < XInterface > xSource( (XPropertySet *)this, UNO_QUERY ); Reference < XInterface > xSource( static_cast<XPropertySet *>(this), UNO_QUERY );
sal_Int32 nFirePos = 0; sal_Int32 nFirePos = 0;
for( i = 0; i < nLen; i++ ) for( i = 0; i < nLen; i++ )
{ {

View File

@@ -350,7 +350,7 @@ OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt)
if (m_XWeakConnectionPoint.is()) if (m_XWeakConnectionPoint.is())
{ {
m_XWeakConnectionPoint->addReference((XReference*)this); m_XWeakConnectionPoint->addReference(static_cast<XReference*>(this));
} }
} }
} }
@@ -365,7 +365,7 @@ OWeakRefListener::~OWeakRefListener()
if (m_XWeakConnectionPoint.is()) if (m_XWeakConnectionPoint.is())
{ {
acquire(); // dont die again acquire(); // dont die again
m_XWeakConnectionPoint->removeReference((XReference*)this); m_XWeakConnectionPoint->removeReference(static_cast<XReference*>(this));
} }
} }
catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no unexpected() catch (RuntimeException &) { OSL_ASSERT( false ); } // assert here, but no unexpected()
@@ -405,7 +405,7 @@ void SAL_CALL OWeakRefListener::dispose()
} }
if( xAdp.is() ) if( xAdp.is() )
xAdp->removeReference((XReference*)this); xAdp->removeReference(static_cast<XReference*>(this));
} }
@@ -441,7 +441,7 @@ void WeakReferenceHelper::clear()
if (m_pImpl->m_XWeakConnectionPoint.is()) if (m_pImpl->m_XWeakConnectionPoint.is())
{ {
m_pImpl->m_XWeakConnectionPoint->removeReference( m_pImpl->m_XWeakConnectionPoint->removeReference(
(XReference*)m_pImpl); static_cast<XReference*>(m_pImpl));
m_pImpl->m_XWeakConnectionPoint.clear(); m_pImpl->m_XWeakConnectionPoint.clear();
} }
m_pImpl->release(); m_pImpl->release();