diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-20 10:49:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-22 06:50:35 +0000 |
commit | 8aaa1778bb7b65b6e498c26fb03fd8757a3329ae (patch) | |
tree | 449550a9d173c66041db0b2c27069906b2faa339 /sw/source | |
parent | ebf6bf0e32d3b937be2d950591d3abffde135b14 (diff) |
XUnoTunnel->dynamic_cast in SwXDispatchProviderInterceptor
just store the underlying type, elides the need for dynamic_cast
Change-Id: I974bf72f71a37b8dae25750c8f29648bb67adc09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/inc/uivwimp.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/inc/unodispatch.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/uiview/uivwimp.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/uno/unodispatch.cxx | 12 |
4 files changed, 4 insertions, 22 deletions
diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx index 352469f33401..0d401d92f78d 100644 --- a/sw/source/uibase/inc/uivwimp.hxx +++ b/sw/source/uibase/inc/uivwimp.hxx @@ -82,10 +82,11 @@ public: }; class SwMailMergeConfigItem; +class SwXDispatchProviderInterceptor; class SwView_Impl { - css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xDispatchProviderInterceptor; + rtl::Reference< SwXDispatchProviderInterceptor > m_xDispatchProviderInterceptor; css::uno::Reference< css::view::XSelectionSupplier > mxXTextView; // UNO object std::vector< unotools::WeakReference< SwTransferable > > mxTransferables; diff --git a/sw/source/uibase/inc/unodispatch.hxx b/sw/source/uibase/inc/unodispatch.hxx index b748d5a1052d..961637788f5a 100644 --- a/sw/source/uibase/inc/unodispatch.hxx +++ b/sw/source/uibase/inc/unodispatch.hxx @@ -22,7 +22,6 @@ #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> #include <com/sun/star/view/XSelectionChangeListener.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/frame/XInterceptorInfo.hpp> #include <cppuhelper/implbase.hxx> @@ -35,7 +34,6 @@ class SwXDispatchProviderInterceptor final : public cppu::WeakImplHelper < css::frame::XDispatchProviderInterceptor, css::lang::XEventListener, - css::lang::XUnoTunnel, css::frame::XInterceptorInfo > { @@ -79,10 +77,6 @@ public: // XEventListener virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; - //XUnoTunnel - static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - // XInterceptorInfo virtual css::uno::Sequence<OUString> SAL_CALL getInterceptedURLs() override; diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index ee9693bd8c3b..f5dc49330f83 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -61,9 +61,8 @@ SwView_Impl::SwView_Impl(SwView* pShell) SwView_Impl::~SwView_Impl() { - auto pInterceptor = comphelper::getFromUnoTunnel<SwXDispatchProviderInterceptor>(m_xDispatchProviderInterceptor); - if(pInterceptor) - pInterceptor->Invalidate(); + if(m_xDispatchProviderInterceptor) + m_xDispatchProviderInterceptor->Invalidate(); view::XSelectionSupplier* pTextView = mxXTextView.get(); static_cast<SwXTextView*>(pTextView)->Invalidate(); mxXTextView.clear(); diff --git a/sw/source/uibase/uno/unodispatch.cxx b/sw/source/uibase/uno/unodispatch.cxx index 0c7f465806d9..8e65ff58bc9f 100644 --- a/sw/source/uibase/uno/unodispatch.cxx +++ b/sw/source/uibase/uno/unodispatch.cxx @@ -151,18 +151,6 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& ) m_xIntercepted = nullptr; } -const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId() -{ - static const comphelper::UnoIdInit theSwXDispatchProviderInterceptorUnoTunnelId; - return theSwXDispatchProviderInterceptorUnoTunnelId.getSeq(); -} - -sal_Int64 SwXDispatchProviderInterceptor::getSomething( - const uno::Sequence< sal_Int8 >& aIdentifier ) -{ - return comphelper::getSomethingImpl(aIdentifier, this); -} - void SwXDispatchProviderInterceptor::Invalidate() { DispatchMutexLock_Impl aLock; |