diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-06 12:34:08 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-29 15:00:48 +0200 |
commit | 309b0b4c5ddeada676fd983576f9b89e39965fd1 (patch) | |
tree | 9851be4a619819820812a6eb6949956e61cb4943 | |
parent | framework: last dispatchInterceptor gets asked first (diff) | |
download | core-309b0b4c5ddeada676fd983576f9b89e39965fd1.tar.gz core-309b0b4c5ddeada676fd983576f9b89e39965fd1.zip |
SwXDispatchProviderInterceptor: implement frame::XInterceptorInfo
With this, framework::InterceptionHelper can make a better decision what
interceptor to call: it can avoid calling SwXDispatchProviderInterceptor
when the sw code would just call the previous interceptor anyway.
Reviewed-on: https://gerrit.libreoffice.org/25961
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit b0d819ac5667a07f629f2acb5d3c542fa76d348b)
Conflicts:
sw/source/uibase/inc/unodispatch.hxx
sw/source/uibase/uno/unodispatch.cxx
Change-Id: I92897f2c8baa264dc9ccbc11b63f415da30a910d
-rw-r--r-- | sw/source/ui/inc/unodispatch.hxx | 11 | ||||
-rw-r--r-- | sw/source/ui/uno/unodispatch.cxx | 8 |
2 files changed, 16 insertions, 3 deletions
diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx index d87303037df9..1782353cc4d0 100644 --- a/sw/source/ui/inc/unodispatch.hxx +++ b/sw/source/ui/inc/unodispatch.hxx @@ -24,18 +24,20 @@ #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/implbase2.hxx> -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase4.hxx> #include <list> #include <osl/mutex.hxx> class SwView; -class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper3 +class SwXDispatchProviderInterceptor : public cppu::WeakImplHelper4 < ::com::sun::star::frame::XDispatchProviderInterceptor, ::com::sun::star::lang::XEventListener, - ::com::sun::star::lang::XUnoTunnel + ::com::sun::star::lang::XUnoTunnel, + ::com::sun::star::frame::XInterceptorInfo > { class DispatchMutexLock_Impl @@ -83,6 +85,9 @@ public: static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + // XInterceptorInfo + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getInterceptedURLs() throw(::com::sun::star::uno::RuntimeException); + // view destroyed void Invalidate(); }; diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx index dd2089f14103..5c920fabaa65 100644 --- a/sw/source/ui/uno/unodispatch.cxx +++ b/sw/source/ui/uno/unodispatch.cxx @@ -91,6 +91,14 @@ uno::Reference< frame::XDispatch > SwXDispatchProviderInterceptor::queryDispatch return xResult; } +uno::Sequence<OUString> SwXDispatchProviderInterceptor::getInterceptedURLs() throw (uno::RuntimeException) +{ + uno::Sequence<OUString> aRet(1); + aRet[0] = OUString(".uno:DataSourceBrowser/*"); + + return aRet; +} + uno::Sequence< uno::Reference< frame::XDispatch > > SwXDispatchProviderInterceptor::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& aDescripts ) throw(uno::RuntimeException) { |