From 8aaa1778bb7b65b6e498c26fb03fd8757a3329ae Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Jan 2023 10:49:33 +0200 Subject: 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 --- sw/source/uibase/inc/uivwimp.hxx | 3 ++- sw/source/uibase/inc/unodispatch.hxx | 6 ------ sw/source/uibase/uiview/uivwimp.cxx | 5 ++--- 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 #include #include -#include #include #include #include @@ -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 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(m_xDispatchProviderInterceptor); - if(pInterceptor) - pInterceptor->Invalidate(); + if(m_xDispatchProviderInterceptor) + m_xDispatchProviderInterceptor->Invalidate(); view::XSelectionSupplier* pTextView = mxXTextView.get(); static_cast(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; -- cgit