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 /framework/source/services | |
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 'framework/source/services')
-rw-r--r-- | framework/source/services/autorecovery.cxx | 4 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 2 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 26 |
3 files changed, 13 insertions, 19 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 43869f7bdc44..4455f810a938 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2185,7 +2185,7 @@ void AutoRecovery::implts_startModifyListeningOnDoc(AutoRecovery::TDocumentInfo& css::uno::Reference< css::util::XModifyBroadcaster > xBroadcaster(rInfo.Document, css::uno::UNO_QUERY); if (xBroadcaster.is()) { - css::uno::Reference< css::util::XModifyListener > xThis(static_cast< css::frame::XDispatch* >(this), css::uno::UNO_QUERY); + css::uno::Reference< css::util::XModifyListener > xThis(this); xBroadcaster->addModifyListener(xThis); rInfo.ListenForModify = true; } @@ -2199,7 +2199,7 @@ void AutoRecovery::implts_stopModifyListeningOnDoc(AutoRecovery::TDocumentInfo& css::uno::Reference< css::util::XModifyBroadcaster > xBroadcaster(rInfo.Document, css::uno::UNO_QUERY); if (xBroadcaster.is()) { - css::uno::Reference< css::util::XModifyListener > xThis(static_cast< css::frame::XDispatch* >(this), css::uno::UNO_QUERY); + css::uno::Reference< css::util::XModifyListener > xThis(this); xBroadcaster->removeModifyListener(xThis); rInfo.ListenForModify = false; } diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index e431c4dd520d..55af0d9c109a 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -583,7 +583,7 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Desktop::loadComponentFrom TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); SAL_INFO( "fwk.desktop", "loadComponentFromURL" ); - css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XComponentLoader > xThis(this); utl::MediaDescriptor aDescriptor(lArguments); bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault("OnMainThread", false); diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index 6603ceaaecc3..56a1a7b1e623 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -580,7 +580,7 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL XFrameImpl::loadComponentF { checkDisposed(); - css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XComponentLoader > xThis(this); utl::MediaDescriptor aDescriptor(lArguments); bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault("OnMainThread", false); @@ -1242,7 +1242,7 @@ void SAL_CALL XFrameImpl::activate() // he is threadsafe himself and live if we live. css::uno::Reference< css::frame::XFrame > xActiveChild = m_aChildFrameContainer.getActive(); css::uno::Reference< css::frame::XFramesSupplier > xParent = m_xParent; - css::uno::Reference< css::frame::XFrame > xThis ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XFrame > xThis(this); EActiveState eState = m_eActiveState; aWriteLock.clear(); @@ -1320,7 +1320,7 @@ void SAL_CALL XFrameImpl::deactivate() // Copy necessary member and free the lock. css::uno::Reference< css::frame::XFrame > xActiveChild = m_aChildFrameContainer.getActive(); css::uno::Reference< css::frame::XFramesSupplier > xParent = m_xParent; - css::uno::Reference< css::frame::XFrame > xThis ( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XFrame > xThis(this); EActiveState eState = m_eActiveState; aWriteLock.clear(); @@ -2082,7 +2082,7 @@ void SAL_CALL XFrameImpl::disposing() // We should hold a reference to ourself ... // because our owner dispose us and release our reference ... // May be we will die before we could finish this method ... - css::uno::Reference< css::frame::XFrame > xThis( static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XFrame > xThis(this); SAL_INFO("fwk.frame", "[Frame] " << m_sName << " send dispose event to listener"); @@ -3108,12 +3108,9 @@ void XFrameImpl::implts_startWindowListening() SolarMutexClearableGuard aReadLock; css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; - css::uno::Reference< css::awt::XWindowListener > xWindowListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); - css::uno::Reference< css::awt::XFocusListener > xFocusListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); - css::uno::Reference< css::awt::XTopWindowListener > xTopWindowListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); + css::uno::Reference< css::awt::XWindowListener > xWindowListener(this); + css::uno::Reference< css::awt::XFocusListener > xFocusListener(this); + css::uno::Reference< css::awt::XTopWindowListener > xTopWindowListener(this); aReadLock.clear(); /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ @@ -3147,12 +3144,9 @@ void XFrameImpl::implts_stopWindowListening() SolarMutexClearableGuard aReadLock; css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; - css::uno::Reference< css::awt::XWindowListener > xWindowListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); - css::uno::Reference< css::awt::XFocusListener > xFocusListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); - css::uno::Reference< css::awt::XTopWindowListener > xTopWindowListener( static_cast< ::cppu::OWeakObject* >(this), - css::uno::UNO_QUERY ); + css::uno::Reference< css::awt::XWindowListener > xWindowListener(this); + css::uno::Reference< css::awt::XFocusListener > xFocusListener(this); + css::uno::Reference< css::awt::XTopWindowListener > xTopWindowListener(this); aReadLock.clear(); /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ |