Kaydet (Commit) d5dde729 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast: deal with remaining pointer casts

Change-Id: Ie55f464ef2eca344d3c1292713ded2710c47cc53
üst cec7d0a9
...@@ -218,7 +218,7 @@ void DocumentHolder::CloseFrame() ...@@ -218,7 +218,7 @@ void DocumentHolder::CloseFrame()
{ {
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY ); uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
if ( xCloseBroadcaster.is() ) if ( xCloseBroadcaster.is() )
xCloseBroadcaster->removeCloseListener( ( util::XCloseListener* )this ); xCloseBroadcaster->removeCloseListener( static_cast<util::XCloseListener*>(this) );
uno::Reference<util::XCloseable> xCloseable( uno::Reference<util::XCloseable> xCloseable(
m_xFrame,uno::UNO_QUERY ); m_xFrame,uno::UNO_QUERY );
...@@ -277,14 +277,14 @@ void DocumentHolder::CloseDocument( bool bDeliverOwnership, bool bWaitForClose ) ...@@ -277,14 +277,14 @@ void DocumentHolder::CloseDocument( bool bDeliverOwnership, bool bWaitForClose )
{ {
uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY ); uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY );
if ( xEventBroadcaster.is() ) if ( xEventBroadcaster.is() )
xEventBroadcaster->removeEventListener( ( document::XEventListener* )this ); xEventBroadcaster->removeEventListener( static_cast<document::XEventListener*>(this) );
else else
{ {
// the object does not support document::XEventBroadcaster interface // the object does not support document::XEventBroadcaster interface
// use the workaround, register for modified events // use the workaround, register for modified events
uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY ); uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY );
if ( xModifyBroadcaster.is() ) if ( xModifyBroadcaster.is() )
xModifyBroadcaster->removeModifyListener( ( util::XModifyListener* )this ); xModifyBroadcaster->removeModifyListener( static_cast<util::XModifyListener*>(this) );
} }
uno::Reference< util::XCloseable > xCloseable( xBroadcaster, uno::UNO_QUERY ); uno::Reference< util::XCloseable > xCloseable( xBroadcaster, uno::UNO_QUERY );
...@@ -483,7 +483,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar ...@@ -483,7 +483,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY ); uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
if ( xCloseBroadcaster.is() ) if ( xCloseBroadcaster.is() )
xCloseBroadcaster->addCloseListener( ( util::XCloseListener* )this ); xCloseBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
// TODO: some listeners to the frame and the window ( resize for example ) // TODO: some listeners to the frame and the window ( resize for example )
} }
...@@ -500,7 +500,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar ...@@ -500,7 +500,7 @@ bool DocumentHolder::ShowInplace( const uno::Reference< awt::XWindowPeer >& xPar
if ( xControllerBorder.is() ) if ( xControllerBorder.is() )
{ {
m_aBorderWidths = xControllerBorder->getBorder(); m_aBorderWidths = xControllerBorder->getBorder();
xControllerBorder->addBorderResizeListener( (frame::XBorderResizeListener*)this ); xControllerBorder->addBorderResizeListener( static_cast<frame::XBorderResizeListener*>(this) );
} }
PlaceFrame( aRectangleToShow ); PlaceFrame( aRectangleToShow );
...@@ -852,7 +852,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame() ...@@ -852,7 +852,7 @@ uno::Reference< frame::XFrame > DocumentHolder::GetDocFrame()
uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY ); uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( m_xFrame, uno::UNO_QUERY );
if ( xCloseBroadcaster.is() ) if ( xCloseBroadcaster.is() )
xCloseBroadcaster->addCloseListener( ( util::XCloseListener* )this ); xCloseBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
} }
if ( m_xComponent.is() ) if ( m_xComponent.is() )
...@@ -935,18 +935,18 @@ void DocumentHolder::SetComponent( const uno::Reference< util::XCloseable >& xDo ...@@ -935,18 +935,18 @@ void DocumentHolder::SetComponent( const uno::Reference< util::XCloseable >& xDo
uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xComponent, uno::UNO_QUERY ); uno::Reference< util::XCloseBroadcaster > xBroadcaster( m_xComponent, uno::UNO_QUERY );
if ( xBroadcaster.is() ) if ( xBroadcaster.is() )
xBroadcaster->addCloseListener( ( util::XCloseListener* )this ); xBroadcaster->addCloseListener( static_cast<util::XCloseListener*>(this) );
uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY ); uno::Reference< document::XEventBroadcaster > xEventBroadcaster( m_xComponent, uno::UNO_QUERY );
if ( xEventBroadcaster.is() ) if ( xEventBroadcaster.is() )
xEventBroadcaster->addEventListener( ( document::XEventListener* )this ); xEventBroadcaster->addEventListener( static_cast<document::XEventListener*>(this) );
else else
{ {
// the object does not support document::XEventBroadcaster interface // the object does not support document::XEventBroadcaster interface
// use the workaround, register for modified events // use the workaround, register for modified events
uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY ); uno::Reference< util::XModifyBroadcaster > xModifyBroadcaster( m_xComponent, uno::UNO_QUERY );
if ( xModifyBroadcaster.is() ) if ( xModifyBroadcaster.is() )
xModifyBroadcaster->addModifyListener( ( util::XModifyListener* )this ); xModifyBroadcaster->addModifyListener( static_cast<util::XModifyListener*>(this) );
} }
if ( m_xFrame.is() ) if ( m_xFrame.is() )
...@@ -1163,7 +1163,7 @@ void SAL_CALL DocumentHolder::notifyTermination( const lang::EventObject& aSourc ...@@ -1163,7 +1163,7 @@ void SAL_CALL DocumentHolder::notifyTermination( const lang::EventObject& aSourc
uno::Reference< frame::XDesktop > xDesktop( aSource.Source, uno::UNO_QUERY ); uno::Reference< frame::XDesktop > xDesktop( aSource.Source, uno::UNO_QUERY );
m_bDesktopTerminated = true; m_bDesktopTerminated = true;
if ( xDesktop.is() ) if ( xDesktop.is() )
xDesktop->removeTerminateListener( ( frame::XTerminateListener* )this ); xDesktop->removeTerminateListener( static_cast<frame::XTerminateListener*>(this) );
} }
......
...@@ -250,17 +250,17 @@ Interceptor::queryDispatch( ...@@ -250,17 +250,17 @@ Interceptor::queryDispatch(
{ {
osl::MutexGuard aGuard(m_aMutex); osl::MutexGuard aGuard(m_aMutex);
if(URL.Complete == m_aInterceptedURL[0]) if(URL.Complete == m_aInterceptedURL[0])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[1]) else if(URL.Complete == m_aInterceptedURL[1])
return (frame::XDispatch*)0 ; return nullptr ;
else if(URL.Complete == m_aInterceptedURL[2]) else if(URL.Complete == m_aInterceptedURL[2])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[3]) else if(URL.Complete == m_aInterceptedURL[3])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[4]) else if(URL.Complete == m_aInterceptedURL[4])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else if(URL.Complete == m_aInterceptedURL[5]) else if(URL.Complete == m_aInterceptedURL[5])
return (frame::XDispatch*)this; return static_cast<frame::XDispatch*>(this);
else { else {
if(m_xSlaveDispatchProvider.is()) if(m_xSlaveDispatchProvider.is())
return m_xSlaveDispatchProvider->queryDispatch( return m_xSlaveDispatchProvider->queryDispatch(
...@@ -286,17 +286,17 @@ Interceptor::queryDispatches( ...@@ -286,17 +286,17 @@ Interceptor::queryDispatches(
for(sal_Int32 i = 0; i < Requests.getLength(); ++i) for(sal_Int32 i = 0; i < Requests.getLength(); ++i)
if(m_aInterceptedURL[0] == Requests[i].FeatureURL.Complete) if(m_aInterceptedURL[0] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[1] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[1] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) 0; aRet[i] = nullptr;
else if(m_aInterceptedURL[2] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[2] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[3] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[3] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[4] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[4] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
else if(m_aInterceptedURL[5] == Requests[i].FeatureURL.Complete) else if(m_aInterceptedURL[5] == Requests[i].FeatureURL.Complete)
aRet[i] = (frame::XDispatch*) this; aRet[i] = static_cast<frame::XDispatch*>(this);
return aRet; return aRet;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment