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 /svtools/source/uno | |
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 'svtools/source/uno')
-rw-r--r-- | svtools/source/uno/popupmenucontrollerbase.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/toolboxcontroller.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx index d9cffe188c4c..b5d69c88713a 100644 --- a/svtools/source/uno/popupmenucontrollerbase.cxx +++ b/svtools/source/uno/popupmenucontrollerbase.cxx @@ -178,7 +178,7 @@ void SAL_CALL PopupMenuControllerBase::updatePopupMenu() void PopupMenuControllerBase::updateCommand( const OUString& rCommandURL ) { osl::ClearableMutexGuard aLock( m_aMutex ); - Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XStatusListener > xStatusListener(this); Reference< XDispatch > xDispatch( m_xDispatch ); URL aTargetURL; aTargetURL.Complete = rCommandURL; @@ -342,7 +342,7 @@ void SAL_CALL PopupMenuControllerBase::setPopupMenu( const Reference< awt::XPopu SolarMutexGuard aSolarMutexGuard; m_xPopupMenu = xPopupMenu; - m_xPopupMenu->addMenuListener( Reference< awt::XMenuListener >( static_cast<OWeakObject*>(this), UNO_QUERY )); + m_xPopupMenu->addMenuListener( Reference< awt::XMenuListener >(this) ); Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index fa881b64ad4b..c18e4c9abae7 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -242,7 +242,7 @@ void SAL_CALL ToolboxController::update() // XComponent void SAL_CALL ToolboxController::dispose() { - Reference< XComponent > xThis( static_cast< OWeakObject* >(this), UNO_QUERY ); + Reference< XComponent > xThis(this); { SolarMutexGuard aSolarMutexGuard; @@ -254,7 +254,7 @@ void SAL_CALL ToolboxController::dispose() m_aListenerContainer.disposeAndClear( aEvent ); SolarMutexGuard aSolarMutexGuard; - Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XStatusListener > xStatusListener(this); for (auto const& listener : m_aListenerMap) { try @@ -413,7 +413,7 @@ void ToolboxController::addStatusListener( const OUString& aCommandURL ) m_xUrlTransformer->parseStrict( aTargetURL ); xDispatch = xDispatchProvider->queryDispatch( aTargetURL, OUString(), 0 ); - xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener = this; URLToDispatchMap::iterator aIter = m_aListenerMap.find( aCommandURL ); if ( aIter != m_aListenerMap.end() ) { @@ -455,7 +455,7 @@ void ToolboxController::removeStatusListener( const OUString& aCommandURL ) return; Reference< XDispatch > xDispatch( pIter->second ); - Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XStatusListener > xStatusListener(this); m_aListenerMap.erase( pIter ); try @@ -488,7 +488,7 @@ void ToolboxController::bindListener() Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); if ( m_xContext.is() && xDispatchProvider.is() ) { - xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener = this; for (auto & listener : m_aListenerMap) { css::util::URL aTargetURL; @@ -575,7 +575,7 @@ void ToolboxController::unbindListener() if ( !(m_xContext.is() && xDispatchProvider.is()) ) return; - Reference< XStatusListener > xStatusListener( static_cast< OWeakObject* >( this ), UNO_QUERY ); + Reference< XStatusListener > xStatusListener(this); for (auto & listener : m_aListenerMap) { css::util::URL aTargetURL; @@ -619,7 +619,7 @@ void ToolboxController::updateStatus( const OUString& aCommandURL ) // Try to find a dispatch object for the requested command URL Reference< XDispatchProvider > xDispatchProvider( m_xFrame, UNO_QUERY ); - xStatusListener.set( static_cast< OWeakObject* >( this ), UNO_QUERY ); + xStatusListener = this; if ( m_xContext.is() && xDispatchProvider.is() ) { aTargetURL.Complete = aCommandURL; |