diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-23 10:15:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-23 15:25:26 +0200 |
commit | 8a54339fc83fe9abaaace6f9f374697e6923d684 (patch) | |
tree | 516e82bb9eca2d586aa7acebbe369f67ff707a7f /embeddedobj | |
parent | d34f1df73806e9ca05fa0d07da619e2c0f01b6f7 (diff) |
loplugin:referencecasting look through more clang Types
Note that because of where the fix resides, loplugin:redundantcast
also notices a few more things.
Change-Id: I0b66047fadfff2c5ceafcbd3eab085de00d861a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120865
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/ownview.cxx | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx index 75a41d0a1ac9..68843ec16cf2 100644 --- a/embeddedobj/source/msole/ownview.cxx +++ b/embeddedobj/source/msole/ownview.cxx @@ -112,8 +112,7 @@ bool OwnView_Impl::CreateModelFromURL( const OUString& aFileURL ) aArgs[1].Value <<= true; aArgs[2].Name = "InteractionHandler"; - aArgs[2].Value <<= uno::Reference< task::XInteractionHandler >( - static_cast< ::cppu::OWeakObject* >( new DummyHandler_Impl() ), uno::UNO_QUERY ); + aArgs[2].Value <<= uno::Reference< task::XInteractionHandler >( new DummyHandler_Impl() ); aArgs[3].Name = "DontEdit"; aArgs[3].Value <<= true; @@ -135,16 +134,12 @@ bool OwnView_Impl::CreateModelFromURL( const OUString& aFileURL ) { uno::Reference< document::XEventBroadcaster > xBroadCaster( xModel, uno::UNO_QUERY ); if ( xBroadCaster.is() ) - xBroadCaster->addEventListener( uno::Reference< document::XEventListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xBroadCaster->addEventListener( uno::Reference< document::XEventListener >(this) ); uno::Reference< util::XCloseable > xCloseable( xModel, uno::UNO_QUERY ); if ( xCloseable.is() ) { - xCloseable->addCloseListener( uno::Reference< util::XCloseListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xCloseable->addCloseListener( uno::Reference< util::XCloseListener >(this) ); ::osl::MutexGuard aGuard( m_aMutex ); m_xModel = xModel; @@ -544,16 +539,12 @@ void OwnView_Impl::Close() try { uno::Reference< document::XEventBroadcaster > xBroadCaster( xModel, uno::UNO_QUERY ); if ( xBroadCaster.is() ) - xBroadCaster->removeEventListener( uno::Reference< document::XEventListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xBroadCaster->removeEventListener( uno::Reference< document::XEventListener >( this ) ); uno::Reference< util::XCloseable > xCloseable( xModel, uno::UNO_QUERY ); if ( xCloseable.is() ) { - xCloseable->removeCloseListener( uno::Reference< util::XCloseListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xCloseable->removeCloseListener( uno::Reference< util::XCloseListener >( this ) ); xCloseable->close( true ); } } @@ -585,15 +576,11 @@ void SAL_CALL OwnView_Impl::notifyEvent( const document::EventObject& aEvent ) try { uno::Reference< document::XEventBroadcaster > xBroadCaster( xModel, uno::UNO_QUERY ); if ( xBroadCaster.is() ) - xBroadCaster->removeEventListener( uno::Reference< document::XEventListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xBroadCaster->removeEventListener( uno::Reference< document::XEventListener >( this ) ); uno::Reference< util::XCloseable > xCloseable( xModel, uno::UNO_QUERY ); if ( xCloseable.is() ) - xCloseable->removeCloseListener( uno::Reference< util::XCloseListener >( - static_cast< ::cppu::OWeakObject* >( this ), - uno::UNO_QUERY ) ); + xCloseable->removeCloseListener( uno::Reference< util::XCloseListener >( this ) ); } catch( uno::Exception& ) {} |