framework/Library_fwl.mk | 1 framework/inc/dispatch/interceptionhelper.hxx | 4 framework/inc/services.h | 1 framework/source/dispatch/dispatchdisabler.cxx | 171 ++++++++++ framework/source/dispatch/interceptionhelper.cxx | 45 -- framework/source/inc/dispatch/dispatchdisabler.hxx | 117 ++++++ framework/source/register/registertemp.cxx | 6 framework/util/fwl.component | 3 javaunohelper/com/sun/star/comp/helper/Bootstrap.java | 2 javaunohelper/com/sun/star/comp/helper/ComponentContextEntry.java | 2 javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java | 18 - javaunohelper/com/sun/star/lib/uno/helper/Factory.java | 1 javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java | 17 javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java | 2 ridljar/com/sun/star/uno/IEnvironment.java | 2 ridljar/com/sun/star/uno/IMethodDescription.java | 4 ridljar/com/sun/star/uno/ITypeDescription.java | 18 - ridljar/com/sun/star/uno/Type.java | 2 ridljar/com/sun/star/uno/Union.java | 2 sw/source/ui/inc/unodispatch.hxx | 11 sw/source/ui/uno/unodispatch.cxx | 8 21 files changed, 364 insertions(+), 73 deletions(-)
New commits: commit 309b0b4c5ddeada676fd983576f9b89e39965fd1 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Jun 6 12:34:08 2016 +0200 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 <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> (cherry picked from commit b0d819ac5667a07f629f2acb5d3c542fa76d348b) Conflicts: sw/source/uibase/inc/unodispatch.hxx sw/source/uibase/uno/unodispatch.cxx Change-Id: I92897f2c8baa264dc9ccbc11b63f415da30a910d diff --git a/sw/source/ui/inc/unodispatch.hxx b/sw/source/ui/inc/unodispatch.hxx index d873030..1782353 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 dd2089f..5c920fa 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) { commit 4b02ce1f57c0a374b6040e2cd68213c9a2ea456e Author: Thorsten Behrens <thorsten.behr...@cib.de> Date: Fri May 20 16:48:00 2016 +0200 framework: last dispatchInterceptor gets asked first Align implementation with API contract as spelled out in offapi/com/sun/star/frame/XDispatchProviderInterception.idl - no idea why this change happenend in 2003: Date: Fri Apr 4 16:16:05 2003 +0000 INTEGRATION: CWS fwk01 (1.1.72); FILE MERGED 2003/04/01 12:40:09 as 1.1.72.1: #107642# change order of used interception objects At any rate, with this change extensions actually get a chance to see dispatch requests first, and process/ignore at will. Change-Id: I58876150ee6d67e592f41b3e82a9ffc314e091a3 Reviewed-on: https://gerrit.libreoffice.org/25215 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 08cf2fd01064306eef7fdbb5b62320947c4d1089) diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index b38ee58..e142db4 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -150,20 +150,19 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: // b) OK - there is at least one interceptor already registered. // It's slave and it's master must be valid references ... - // because we created it. But we have to look for the static bool which - // regulate direction of using of interceptor objects! + // because we created it. - // insert it behind any other existing interceptor - means at the end of our list. + // insert it before any other existing interceptor - means at the beginning of our list. else { - css::uno::Reference< css::frame::XDispatchProvider > xMasterD = m_lInterceptionRegs.rbegin()->xInterceptor; - css::uno::Reference< css::frame::XDispatchProviderInterceptor > xMasterI (xMasterD, css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XDispatchProvider > xSlaveD = m_lInterceptionRegs.begin()->xInterceptor; + css::uno::Reference< css::frame::XDispatchProviderInterceptor > xSlaveI (xSlaveD , css::uno::UNO_QUERY); - xInterceptor->setMasterDispatchProvider(xMasterD ); - xInterceptor->setSlaveDispatchProvider (m_xSlave ); - xMasterI->setSlaveDispatchProvider (aInfo.xInterceptor); + xInterceptor->setMasterDispatchProvider(xThis ); + xInterceptor->setSlaveDispatchProvider (xSlaveD ); + xSlaveI->setMasterDispatchProvider (aInfo.xInterceptor); - m_lInterceptionRegs.push_back(aInfo); + m_lInterceptionRegs.push_front(aInfo); } css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); commit 3335c2ec962e08f78f833fb4f62869d2d587fef0 Author: Thorsten Behrens <thorsten.behr...@cib.de> Date: Wed Mar 2 15:28:36 2016 +0100 framework: avoid excessive queryDispatch calls Make better use of the css::frame::XInterceptorInfo interface, to avoid calling queryDispatch() pointlessly on interfaces that have explicitely opted out. Since that already broadcasts which urls we're interested in - so just don't bother calling entries who are not matching. Reviewed-on: https://gerrit.libreoffice.org/25214 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit 27b6cdb5ab5af33dbba561923c8db81e144c88b9) Conflicts: framework/source/dispatch/interceptionhelper.cxx Change-Id: Id5e780568fd60c38f4cee4ee800d747d65a31dae diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 8052ecd..b38ee58 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -66,16 +66,23 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD xInterceptor = pIt->xInterceptor; // b) No match by registration - but a valid interceptor list. - // Use first interceptor everytimes. - // Note: it doesn't matter, which direction this helper implementation use to ask interceptor objects. - // Using of member m_aInterceptorList will starts at the beginning everytimes. - // It depends from the filling operation, in which direction it works realy! + // Find first interceptor w/o pattern, so we need to query it if (!xInterceptor.is() && m_lInterceptionRegs.size()>0) { - pIt = m_lInterceptionRegs.begin(); - xInterceptor = pIt->xInterceptor; + InterceptorList::const_iterator pIt2; + for (pIt2=m_lInterceptionRegs.begin(); pIt2!=m_lInterceptionRegs.end(); ++pIt2) + { + if (!pIt2->lURLPattern.getLength()) + { + // no pattern -> need to ask this guy! + xInterceptor = pIt2->xInterceptor; + break; + } + } + // if we didn't find any non-pattern interceptor, there's no-one + // registered for this command url (we already searched for matching + // patterns above) } - // c) No registered interceptor => use our direct slave. // This helper exist by design and must be valid everytimes ... // But to be more feature proof - we should check that .-) commit bf3c773feddc761ecdf5b8ebb18c78f56d687eb8 Author: shubhamtibra <shubh.ti...@gmail.com> Date: Sat Jan 16 21:50:24 2016 +0530 tdf#96949 Remove global static variable m_bPreferrFirstInterceptor and ... ... unused code Remove global static variable "m_bPreferrFirstInterceptor" which is always true, and remove the ifs where it is false. Reviewed-on: https://gerrit.libreoffice.org/21519 Reviewed-by: jan iversen <j...@documentfoundation.org> Tested-by: jan iversen <j...@documentfoundation.org> (cherry picked from commit 5d4f1f6f630d4382679087a4fb0da364c9c9692b) Conflicts: framework/inc/dispatch/interceptionhelper.hxx framework/source/dispatch/interceptionhelper.cxx Change-Id: I54dcea7a6010c825a66020ec3f7448bb32d120b8 diff --git a/framework/inc/dispatch/interceptionhelper.hxx b/framework/inc/dispatch/interceptionhelper.hxx index 9655706..1787bfa 100644 --- a/framework/inc/dispatch/interceptionhelper.hxx +++ b/framework/inc/dispatch/interceptionhelper.hxx @@ -156,10 +156,6 @@ class InterceptionHelper : public css::frame::XDispatchProvider /** @short contains all registered interceptor objects. */ InterceptorList m_lInterceptionRegs; - /** @short it regulates, which interceptor is used first. - The last or the first registered one. */ - static sal_Bool m_bPreferrFirstInterceptor; - //_____________________________________________________ // native interface diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 1e79645..8052ecd 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -27,8 +27,6 @@ namespace framework{ -sal_Bool InterceptionHelper::m_bPreferrFirstInterceptor = sal_True; - DEFINE_XINTERFACE_3(InterceptionHelper , @@ -148,9 +146,8 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: // because we created it. But we have to look for the static bool which // regulate direction of using of interceptor objects! - // b1) If "m_bPreferrFirstInterceptor" is set to true, we have to // insert it behind any other existing interceptor - means at the end of our list. - else if (m_bPreferrFirstInterceptor) + else { css::uno::Reference< css::frame::XDispatchProvider > xMasterD = m_lInterceptionRegs.rbegin()->xInterceptor; css::uno::Reference< css::frame::XDispatchProviderInterceptor > xMasterI (xMasterD, css::uno::UNO_QUERY); @@ -162,20 +159,6 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: m_lInterceptionRegs.push_back(aInfo); } - // b2) If "m_bPreferrFirstInterceptor" is set to false, we have to - // insert it before any other existing interceptor - means at the beginning of our list. - else - { - css::uno::Reference< css::frame::XDispatchProvider > xSlaveD = m_lInterceptionRegs.begin()->xInterceptor; - css::uno::Reference< css::frame::XDispatchProviderInterceptor > xSlaveI (xSlaveD , css::uno::UNO_QUERY); - - xInterceptor->setMasterDispatchProvider(xThis ); - xInterceptor->setSlaveDispatchProvider (xSlaveD ); - xSlaveI->setMasterDispatchProvider (aInfo.xInterceptor); - - m_lInterceptionRegs.push_front(aInfo); - } - css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); aWriteLock.unlock(); commit 118769393b03826810c7b0cde5637c48f2098318 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Thu May 12 20:32:34 2016 +0200 framework: register DispatchDisabler service Change-Id: I72d9f8b00ba8b2e4e5dc70d7fd77e13ccf9d3bcc Reviewed-on: https://gerrit.libreoffice.org/24940 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> (cherry picked from commit 1f041bf31e071611a15ffa1559d2f5df05a685f0) diff --git a/framework/util/fwl.component b/framework/util/fwl.component index b4a7ed3..7538a32 100644 --- a/framework/util/fwl.component +++ b/framework/util/fwl.component @@ -85,4 +85,7 @@ <implementation name="com.sun.star.comp.framework.services.DispatchHelper"> <service name="com.sun.star.frame.DispatchHelper"/> </implementation> + <implementation name="com.sun.star.comp.framework.services.DispatchDisabler"> + <service name="com.sun.star.frame.DispatchDisabler"/> + </implementation> </component> commit 5de625638dcbd91b9b00681b5398ca78963b82f2 Author: Michael Meeks <michael.me...@collabora.com> Date: Thu Jan 7 19:24:41 2016 +0000 framework: initial implementation of a dispatch disabler. This should allow remote, eg. URE dispatchers to trivially disable lots of the UI without requiring a large volume of round-trip IPC. Reviewed-on: https://gerrit.libreoffice.org/24938 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> (cherry picked from commit 02833c03ee856a62d7185829b7c47bc088e086cc) Conflicts: framework/inc/services.h Change-Id: Ibd0681ac993196f826b4ed411da5ffedb7f85786 diff --git a/framework/Library_fwl.mk b/framework/Library_fwl.mk index 17ba3eb..975f20b 100644 --- a/framework/Library_fwl.mk +++ b/framework/Library_fwl.mk @@ -55,6 +55,7 @@ $(eval $(call gb_Library_add_exception_objects,fwl,\ framework/source/recording/dispatchrecorder \ framework/source/recording/dispatchrecordersupplier \ framework/source/register/registertemp \ + framework/source/dispatch/dispatchdisabler \ framework/source/services/dispatchhelper \ framework/source/services/license \ framework/source/services/mediatypedetectionhelper \ diff --git a/framework/inc/services.h b/framework/inc/services.h index e32de32..6a40244 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -116,6 +116,7 @@ namespace framework{ #define IMPLEMENTATIONNAME_PATHSETTINGS DECLARE_ASCII("com.sun.star.comp.framework.PathSettings" ) #define IMPLEMENTATIONNAME_JOBDISPATCH DECLARE_ASCII("com.sun.star.comp.framework.jobs.JobDispatch" ) #define IMPLEMENTATIONNAME_DISPATCHHELPER DECLARE_ASCII("com.sun.star.comp.framework.services.DispatchHelper" ) +#define IMPLEMENTATIONNAME_DISPATCHDISABLER DECLARE_ASCII("com.sun.star.comp.framework.services.DispatchDisabler") #define IMPLEMENTATIONNAME_LAYOUTMANAGER DECLARE_ASCII("com.sun.star.comp.framework.LayoutManager" ) #define IMPLEMENTATIONNAME_POPUPMENUCONTROLLERFACTORY DECLARE_ASCII("com.sun.star.comp.framework.PopupMenuControllerFactory" ) #define IMPLEMENTATIONNAME_MACROSMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.MacrosMenuController" ) diff --git a/framework/source/dispatch/dispatchdisabler.cxx b/framework/source/dispatch/dispatchdisabler.cxx new file mode 100644 index 0000000..5f410af --- /dev/null +++ b/framework/source/dispatch/dispatchdisabler.cxx @@ -0,0 +1,171 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sal/config.h> + +#include "services.h" +#include "dispatch/dispatchdisabler.hxx" + +#include <com/sun/star/frame/XFrame.hpp> +#include <com/sun/star/frame/DispatchDescriptor.hpp> + +using namespace css; +using namespace framework; + +DispatchDisabler::DispatchDisabler(const uno::Reference< uno::XComponentContext >& rxContext) : + mxContext( rxContext ) +{ +} + +// XInitialization +void SAL_CALL DispatchDisabler::initialize( const uno::Sequence< uno::Any >& aArguments ) + throw (uno::Exception, uno::RuntimeException, ::std::exception) +{ + uno::Sequence< OUString > aDisabledURLs; + if( aArguments.getLength() > 0 && + ( aArguments[0] >>= aDisabledURLs ) ) + { + for( sal_Int32 i = 0; i < aDisabledURLs.getLength(); ++i ) + maDisabledURLs.insert(aDisabledURLs[i]); + } +} + +// XDispatchProvider +uno::Reference< frame::XDispatch > SAL_CALL +DispatchDisabler::queryDispatch( const util::URL& rURL, + const OUString& rTargetFrameName, + ::sal_Int32 nSearchFlags ) + throw (uno::RuntimeException, ::std::exception) +{ + // If present - disabled. + if( maDisabledURLs.find(rURL.Complete) != maDisabledURLs.end() || + !mxSlave.is() ) + return uno::Reference< frame::XDispatch >(); + else + return mxSlave->queryDispatch(rURL, rTargetFrameName, nSearchFlags); +} + +uno::Sequence< uno::Reference< frame::XDispatch > > SAL_CALL +DispatchDisabler::queryDispatches( const uno::Sequence< frame::DispatchDescriptor >& rRequests ) + throw (uno::RuntimeException, ::std::exception) +{ + uno::Sequence< uno::Reference< frame::XDispatch > > aResult(rRequests.getLength()); + for( sal_Int32 i = 0; i < rRequests.getLength(); ++i ) + aResult[i] = queryDispatch(rRequests[i].FeatureURL, + rRequests[i].FrameName, + rRequests[i].SearchFlags); + return aResult; +} + +// XDispatchProviderInterceptor +uno::Reference< frame::XDispatchProvider > SAL_CALL +DispatchDisabler::getSlaveDispatchProvider() throw (uno::RuntimeException, ::std::exception) +{ + return mxSlave; +} + +void SAL_CALL DispatchDisabler::setSlaveDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewDispatchProvider ) + throw (uno::RuntimeException, ::std::exception) +{ + mxSlave = xNewDispatchProvider; +} + +uno::Reference< frame::XDispatchProvider > SAL_CALL +DispatchDisabler::getMasterDispatchProvider() throw (uno::RuntimeException, ::std::exception) +{ + return mxMaster; +} +void SAL_CALL +DispatchDisabler::setMasterDispatchProvider( const uno::Reference< frame::XDispatchProvider >& xNewSupplier ) + throw (uno::RuntimeException, ::std::exception) +{ + mxMaster = xNewSupplier; +} + +// XInterceptorInfo +uno::Sequence< OUString > SAL_CALL + DispatchDisabler::getInterceptedURLs() + throw (uno::RuntimeException, ::std::exception) +{ + uno::Sequence< OUString > aDisabledURLs(maDisabledURLs.size()); + sal_Int32 n = 0; + for (auto i = maDisabledURLs.begin(); i != maDisabledURLs.end(); ++i) + aDisabledURLs[n++] = *i; + return aDisabledURLs; +} + +// XElementAccess +uno::Type SAL_CALL DispatchDisabler::getElementType() + throw (uno::RuntimeException, ::std::exception) +{ + uno::Type aModuleType = cppu::UnoType<OUString>::get(); + return aModuleType; +} + +::sal_Bool SAL_CALL DispatchDisabler::hasElements() + throw (uno::RuntimeException, ::std::exception) +{ + return maDisabledURLs.size() > 0; +} + +// XNameAccess +uno::Any SAL_CALL DispatchDisabler::getByName( const OUString& ) + throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException, ::std::exception) +{ + return uno::Any(); +} + +uno::Sequence< OUString > SAL_CALL DispatchDisabler::getElementNames() + throw (uno::RuntimeException, ::std::exception) +{ + return getInterceptedURLs(); +} + +sal_Bool SAL_CALL DispatchDisabler::hasByName( const OUString& rName ) + throw (uno::RuntimeException, ::std::exception) +{ + return maDisabledURLs.find(rName) != maDisabledURLs.end(); +} + +// XNameReplace +void SAL_CALL DispatchDisabler::replaceByName( const OUString& rName, const uno::Any& aElement ) + throw (lang::IllegalArgumentException, container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException, ::std::exception) +{ + removeByName( rName ); + insertByName( rName, aElement ); +} + +// XNameContainer +void DispatchDisabler::insertByName( const OUString& rName, const uno::Any& ) + throw (lang::IllegalArgumentException, container::ElementExistException, + lang::WrappedTargetException, uno::RuntimeException, ::std::exception) +{ + maDisabledURLs.insert(rName); +} + +void DispatchDisabler::removeByName( const OUString& rName ) + throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException, ::std::exception) +{ + auto it = maDisabledURLs.find(rName); + if( it != maDisabledURLs.end() ) + maDisabledURLs.erase(it); +} + +DEFINE_INIT_SERVICE(DispatchDisabler, {}) + +// XServiceInfo +DEFINE_XSERVICEINFO_MULTISERVICE_2(DispatchDisabler, + ::cppu::OWeakObject, + "com.sun.star.frame.DispatchDisabler", + IMPLEMENTATIONNAME_DISPATCHDISABLER) + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index e3cacde..1e79645 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -110,7 +110,7 @@ css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL Inte void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css::uno::Reference< css::frame::XDispatchProviderInterceptor >& xInterceptor) throw(css::uno::RuntimeException) { - // reject wrong calling of this interface method + // reject incorrect calls of this interface method css::uno::Reference< css::frame::XDispatchProvider > xThis(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY); if (!xInterceptor.is()) throw css::uno::RuntimeException(DECLARE_ASCII("NULL references not allowed as in parameter"), xThis); diff --git a/framework/source/inc/dispatch/dispatchdisabler.hxx b/framework/source/inc/dispatch/dispatchdisabler.hxx new file mode 100644 index 0000000..6b75295 --- /dev/null +++ b/framework/source/inc/dispatch/dispatchdisabler.hxx @@ -0,0 +1,117 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX +#define INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX + +#include <set> + +#include <cppuhelper/implbase5.hxx> +#include <cppuhelper/weakref.hxx> + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/frame/XInterceptorInfo.hpp> +#include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp> + +#include <macros/xserviceinfo.hxx> + +namespace framework { + +/** + * Implementation of a service to make it easy to disable a whole + * suite of UNO commands in a batch - and have that act in-process. + * + * Often external re-use of LibreOffice wants a very cut-down set + * of functionality included, and disabling elements remotely one + * by one performs poorly. + */ +class DispatchDisabler : public ::cppu::WeakImplHelper5< + css::lang::XInitialization, + css::container::XNameContainer, + css::frame::XDispatchProviderInterceptor, + css::frame::XInterceptorInfo, + css::lang::XServiceInfo > +{ + std::set<OUString> maDisabledURLs; + css::uno::Reference< css::frame::XDispatchProvider > mxSlave; + css::uno::Reference< css::frame::XDispatchProvider > mxMaster; + css::uno::Reference< css::uno::XComponentContext > mxContext; +public: + DispatchDisabler(const css::uno::Reference< css::uno::XComponentContext >& rxContext); + virtual ~DispatchDisabler() {} + + // XInitialization + virtual void SAL_CALL initialize( const ::css::uno::Sequence< ::css::uno::Any >& aArguments ) + throw (::css::uno::Exception, ::css::uno::RuntimeException, ::std::exception) override; + + // XDispatchProvider + virtual ::css::uno::Reference< ::css::frame::XDispatch > SAL_CALL + queryDispatch( const ::css::util::URL& URL, + const OUString& TargetFrameName, + ::sal_Int32 SearchFlags ) + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Sequence< ::css::uno::Reference< ::css::frame::XDispatch > > SAL_CALL + queryDispatches( const ::css::uno::Sequence< ::css::frame::DispatchDescriptor >& Requests ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XDispatchProviderInterceptor + virtual ::css::uno::Reference< ::css::frame::XDispatchProvider > SAL_CALL + getSlaveDispatchProvider() throw (::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL + setSlaveDispatchProvider( const ::css::uno::Reference< ::css::frame::XDispatchProvider >& NewDispatchProvider ) + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Reference< ::css::frame::XDispatchProvider > SAL_CALL + getMasterDispatchProvider() throw (::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL + setMasterDispatchProvider( const ::css::uno::Reference< ::css::frame::XDispatchProvider >& NewSupplier ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XInterceptorInfo + virtual ::css::uno::Sequence< OUString > SAL_CALL + getInterceptedURLs() throw (::css::uno::RuntimeException, ::std::exception) override; + + // XElementAccess + virtual ::css::uno::Type SAL_CALL getElementType() + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual ::sal_Bool SAL_CALL hasElements() + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XNameAccess + virtual ::css::uno::Any SAL_CALL getByName( const OUString& aName ) + throw (::css::container::NoSuchElementException, ::css::lang::WrappedTargetException, + ::css::uno::RuntimeException, ::std::exception) override; + virtual ::css::uno::Sequence< OUString > SAL_CALL getElementNames() + throw (::css::uno::RuntimeException, ::std::exception) override; + virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) + throw (::css::uno::RuntimeException, ::std::exception) override; + + // XNameReplace + virtual void SAL_CALL replaceByName( const OUString& aName, const ::css::uno::Any& aElement ) + throw (::css::lang::IllegalArgumentException, ::css::container::NoSuchElementException, + ::css::lang::WrappedTargetException, ::css::uno::RuntimeException, ::std::exception) override; + + // XNameContainer + virtual void SAL_CALL insertByName( const OUString& aName, const ::css::uno::Any& aElement ) + throw (::css::lang::IllegalArgumentException, ::css::container::ElementExistException, + ::css::lang::WrappedTargetException, ::css::uno::RuntimeException, ::std::exception) override; + virtual void SAL_CALL removeByName( const OUString& Name ) + throw (::css::container::NoSuchElementException, ::css::lang::WrappedTargetException, + ::css::uno::RuntimeException, ::std::exception) override; + + DECLARE_XSERVICEINFO +}; + +} // namespace framework + +#endif // INCLUDED_FRAMEWORK_INC_SERVICES_DISPATCH_DISABLER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx index 9d9e673..520fff9 100644 --- a/framework/source/register/registertemp.cxx +++ b/framework/source/register/registertemp.cxx @@ -37,6 +37,7 @@ #include <dispatch/oxt_handler.hxx> #include <dispatch/popupmenudispatcher.hxx> #include <dispatch/servicehandler.hxx> +#include <dispatch/dispatchdisabler.hxx> #include <services/dispatchhelper.hxx> #include <recording/dispatchrecorder.hxx> #include <recording/dispatchrecordersupplier.hxx> @@ -56,14 +57,15 @@ #include <uielement/popupmenucontroller.hxx> COMPONENTGETFACTORY ( fwl, - IFFACTORY( ::framework::MediaTypeDetectionHelper ) - IFFACTORY( ::framework::MailToDispatcher ) else + IFFACTORY( ::framework::MediaTypeDetectionHelper ) + IFFACTORY( ::framework::MailToDispatcher ) else IFFACTORY( ::framework::ServiceHandler ) else IFFACTORY( ::framework::LogoTextStatusbarController ) else IFFACTORY( ::framework::LogoImageStatusbarController ) else IFFACTORY( ::framework::License ) else IFFACTORY( ::framework::PopupMenuDispatcher ) else IFFACTORY( ::framework::DispatchHelper ) else + IFFACTORY( ::framework::DispatchDisabler ) else IFFACTORY( ::framework::DispatchRecorder ) else IFFACTORY( ::framework::DispatchRecorderSupplier ) else IFFACTORY( ::framework::SimpleTextStatusbarController ) else commit eb45cb33344a74add43fe216d0a18c1ca8bef8ef Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Wed Jun 29 14:08:55 2016 +0200 Silence javadoc 8 errors Just the minimal amount of changes to fix the build. Change-Id: I307f4df108caa96ec489ec151bfa47837480b92d diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java index 2087aec..5cdf92b 100644 --- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java +++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java @@ -145,7 +145,7 @@ public class Bootstrap { * Bootstraps a servicemanager with the jurt base components registered. * <p> * @return a freshly boostrapped service manager - * @see com.sun.star.lang.ServiceManager + * @see "com.sun.star.lang.ServiceManager" */ static public XMultiServiceFactory createSimpleServiceManager() throws Exception { diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContextEntry.java b/javaunohelper/com/sun/star/comp/helper/ComponentContextEntry.java index ea1c57e..c68e65c 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContextEntry.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContextEntry.java @@ -24,7 +24,7 @@ package com.sun.star.comp.helper; The first one is commonly used for singleton objects of the component context, that are raised on first-time retrieval of the key. You have to pass a com.sun.star.lang.XSingleComponentFactory - or string (=> service name) object for this. + or string (service name) object for this. </p> */ public class ComponentContextEntry diff --git a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java index a9cfe46..b30f120 100644 --- a/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java +++ b/javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java @@ -32,7 +32,7 @@ import com.sun.star.registry.XRegistryKey; * <p> * @see com.sun.star.loader.SharedLibrary * @see "com.sun.star.comp.servicemanager.ServiceManager" - * @see com.sun.star.lang.ServiceManager + * @see "com.sun.star.lang.ServiceManager" */ public class SharedLibraryLoader { /** @@ -82,8 +82,8 @@ public class SharedLibraryLoader { * @param smgr the ServiceManager * @param regKey the root registry key * @see com.sun.star.loader.SharedLibrary - * @see com.sun.star.lang.ServiceManager - * @see com.sun.star.registry.RegistryKey + * @see "com.sun.star.lang.ServiceManager" + * @see "com.sun.star.registry.RegistryKey" */ public static XSingleServiceFactory getServiceFactory( XMultiServiceFactory smgr, @@ -105,8 +105,8 @@ public class SharedLibraryLoader { * @param smgr the ServiceManager * @param regKey the root registry key * @see com.sun.star.loader.SharedLibrary - * @see com.sun.star.lang.ServiceManager - * @see com.sun.star.registry.RegistryKey + * @see "com.sun.star.lang.ServiceManager" + * @see "com.sun.star.registry.RegistryKey" */ public static XSingleServiceFactory getServiceFactory( String libName, @@ -128,8 +128,8 @@ public class SharedLibraryLoader { * @param smgr the ServiceManager * @param regKey the root key under that the component should be registered * @see com.sun.star.loader.SharedLibrary - * @see com.sun.star.lang.ServiceManager - * @see com.sun.star.registry.RegistryKey + * @see "com.sun.star.lang.ServiceManager" + * @see "com.sun.star.registry.RegistryKey" */ public static boolean writeRegistryServiceInfo( com.sun.star.lang.XMultiServiceFactory smgr, @@ -148,8 +148,8 @@ public class SharedLibraryLoader { * @param smgr the ServiceManager * @param regKey the root key under that the component should be registered * @see com.sun.star.loader.SharedLibrary - * @see com.sun.star.lang.ServiceManager - * @see com.sun.star.registry.RegistryKey + * @see "com.sun.star.lang.ServiceManager" + * @see "com.sun.star.registry.RegistryKey" */ public static boolean writeRegistryServiceInfo( String libName, diff --git a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java index 586498c..b9c5a00 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/Factory.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/Factory.java @@ -29,7 +29,6 @@ import com.sun.star.uno.UnoRuntime; /** Factory helper class supporting com.sun.star.lang.XServiceInfo and com.sun.star.lang.XSingleComponentFactory. - @attention This factory implementation does not support lang.XSingleServiceFactory. */ public class Factory diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java index b257181..ed2ee2c 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java @@ -117,7 +117,7 @@ XMultiPropertySet * initialization of the inheriting class (i.e. within the contructor) * @param name The property's name (Property.Name). * @param handle The property's handle (Property.Handle). - * @param Type The property's type (Property.Type). + * @param type The property's type (Property.Type). * @param attributes The property's attributes (Property.Attributes). * @param id Identifies the property's storage. */ @@ -135,8 +135,7 @@ XMultiPropertySet * Registration has to occur during * initialization of the inheriting class (i.e. within the contructor). * @param name The property's name (Property.Name). - * @param handle The property's handle (Property.Handle). - * @param Type The property's type (Property.Type). + * @param type The property's type (Property.Type). * @param attributes The property's attributes (Property.Attributes). * @param id Identifies the property's storage. */ @@ -558,11 +557,11 @@ XMultiPropertySet * {@link #setFastPropertyValue XFastPropertySet.setFastPropertyValue} * and {@link #setPropertyValues XMultiPropertySet.setPropertyValues}. * If this method fails, that is, it returns false or throws an exception, then no listeners are notified and the - * property value, that was intended to be changed, remains untouched.<br /> This method does not have to deal with property attributes, such as + * property value, that was intended to be changed, remains untouched.<p> This method does not have to deal with property attributes, such as * PropertyAttribute.READONLY or PropertyAttribute.MAYBEVOID. The processing of these attributes occurs - * in the calling methods.<br /> + * in the calling methods.<p> * Only if this method returns successfully further processing, such - * as listener notification and finally the modifiction of the property's value, will occur.<br /> + * as listener notification and finally the modifiction of the property's value, will occur.<p> * * The actual modification of a property's value is done by {@link #setPropertyValueNoBroadcast setPropertyValueNoBroadcast} * which is called subsequent to convertPropertyValue. @@ -588,10 +587,10 @@ XMultiPropertySet * Then, no conversion is necessary, since they can hold all possible values. However, if * the member is an Object and <em>setVal</em> is an Any then the object contained in the any is assigned to * the member. The extra type information which exists as Type object in the Any will get lost. If this is not - * intended then use an Any variable rather then an Object.<br /> + * intended then use an Any variable rather then an Object.<p> * If a member is an Object or Any and the argument <em>setVal</em> is an Object, other than String or array, * then it is presumed to be an UNO object and queried for XInterface. If successful, the out-param <em>newVal</em> - * returns the XInterface.<br /> + * returns the XInterface.<p> * If a member is an UNO interface, then <em>setVal</em> is queried for this interface and the result is returned. * If <em>setVal</em> is null then <em>newVal</em> will be null too after return. * <p> @@ -788,7 +787,7 @@ XMultiPropertySet * If a property has the READONLY attribute set, and one of the setter methods, such as setPropertyValue, has been * called, then this method is not going to be called. * @param property the property for which the new value is set - * @param value the new value for the property. + * @param newVal the new value for the property. * @throws com.sun.star.lang.WrappedTargetException An exception, which has to be made known to the caller, * occurred during the setting of the value. */ diff --git a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java index cd57c63..9844ccb 100644 --- a/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java +++ b/javaunohelper/com/sun/star/lib/uno/helper/PropertySetMixin.java @@ -186,7 +186,7 @@ public final class PropertySetMixin { @param newValue the property value corresponding to the new attribute value. This is only used as <code>com.sun.star.beans.PropertyChangeEvent.NewValue</code>, which is - rather useless, anyway (see “Using the Observer Pattern&rdquo: in + rather useless, anyway (see “Using the Observer Pattern”: in <a href="http://tools.openoffice.org/CodingGuidelines.sxw"> <cite>OpenOffice.org Coding Guidelines</cite></a>), <em>unless</em> the attribute that is going to be set is constrained. If the attribute diff --git a/ridljar/com/sun/star/uno/IEnvironment.java b/ridljar/com/sun/star/uno/IEnvironment.java index 34435ec..dc96341 100644 --- a/ridljar/com/sun/star/uno/IEnvironment.java +++ b/ridljar/com/sun/star/uno/IEnvironment.java @@ -58,7 +58,7 @@ public interface IEnvironment { * given bridge <var>B2</var>.</li> * <li>A proxy object, created as a remote object is mapped into this * environment via a given bridge.</li> - * </ul></p> + * </ul> * * <p>The object actually registered may differ from the specified * <code>object</code> that is passed as an argument. This enables an diff --git a/ridljar/com/sun/star/uno/IMethodDescription.java b/ridljar/com/sun/star/uno/IMethodDescription.java index ffc9833..cb2625a 100644 --- a/ridljar/com/sun/star/uno/IMethodDescription.java +++ b/ridljar/com/sun/star/uno/IMethodDescription.java @@ -47,7 +47,7 @@ public interface IMethodDescription extends IMemberDescription { boolean isConst(); /** - * Gives any array of <code>ITypeDescription> of + * Gives any array of <code>ITypeDescription</code> of * the [in] parameters. * <p> * @return the in parameters @@ -55,7 +55,7 @@ public interface IMethodDescription extends IMemberDescription { ITypeDescription[] getInSignature(); /** - * Gives any array of <code>ITypeDescription> of + * Gives any array of <code>ITypeDescription</code> of * the [out] parameters. * <p> * @return the out parameters diff --git a/ridljar/com/sun/star/uno/ITypeDescription.java b/ridljar/com/sun/star/uno/ITypeDescription.java index 8501445..2d6c2bf 100644 --- a/ridljar/com/sun/star/uno/ITypeDescription.java +++ b/ridljar/com/sun/star/uno/ITypeDescription.java @@ -98,8 +98,8 @@ public interface ITypeDescription { /** * Gets the (UNO) type name. * - * <p>The following table lists how UNO types map to type names:</p> * <table> + * <caption>Mapping from UNO types to type names</caption> * <thead> * <tr><th>UNO type</th><th>type name</th></tr> * </thead> @@ -114,15 +114,15 @@ public interface ITypeDescription { * </tr> * <tr><td>LONG</td><td><code>"long"</code></td></tr> * <tr><td>UNSIGNED LONG</td><td><code>"unsigned long"</code></td></tr> - * <tr><td>HYPER</td><td></td><code>"hyper"</code></tr> + * <tr><td>HYPER</td><td></td><td><code>"hyper"</code></td></tr> * <tr> - * <td>UNSIGNED HYPER</td><td></td><code>"unsigned hyper"</code> + * <td>UNSIGNED HYPER</td><td></td><td><code>"unsigned hyper"</code></td> * </tr> - * <tr><td>FLOAT</td><td></td><code>"float"</code></tr> - * <tr><td>DOUBLE</td><td></td><code>"double"</code></tr> - * <tr><td>STRING</td><td></td><code>"string"</code></tr> - * <tr><td>TYPE</td><td></td><code>"type"</code></tr> - * <tr><td>ANY</td><td></td><code>"any"</code></tr> + * <tr><td>FLOAT</td><td></td><td><code>"float"</code></td></tr> + * <tr><td>DOUBLE</td><td></td><td><code>"double"</code></td></tr> + * <tr><td>STRING</td><td></td><td><code>"string"</code></td></tr> + * <tr><td>TYPE</td><td></td><td><code>"type"</code></td></tr> + * <tr><td>ANY</td><td></td><td><code>"any"</code></td></tr> * <tr> * <td>sequence type of base type <var>T</var></td> * <td><code>"[]"</code> followed by type name for <var>T</var></td> @@ -143,7 +143,7 @@ public interface ITypeDescription { * <td>interface type named <var>N</var></td> * <td><var>N</var> (see below)</td> * </tr> - * <tbody> + * </tbody> * </table> * <p>For a UNO type named <var>N</var>, consisting of a sequence of module * names <var>M<sub>1</sub></var>, ..., <var>M<sub>n</sub></var> followed by diff --git a/ridljar/com/sun/star/uno/Type.java b/ridljar/com/sun/star/uno/Type.java index 539c6eb..c43664b 100644 --- a/ridljar/com/sun/star/uno/Type.java +++ b/ridljar/com/sun/star/uno/Type.java @@ -199,7 +199,7 @@ public class Type { * * <p>In certain cases, one Java class corresponds to two UNO types (e.g., * the Java class <code>short[].class</code> corresponds to both a sequence - * of <codde>SHORT</code> and a sequence of <code>UNSIGNED SHORT</code> in + * of <code>SHORT</code> and a sequence of <code>UNSIGNED SHORT</code> in * UNO). In such ambiguous cases, the parameter <code>alternative</code> * controls which UNO type is chosen:</p> * <ul> diff --git a/ridljar/com/sun/star/uno/Union.java b/ridljar/com/sun/star/uno/Union.java index 8daabbd..0ea8293 100644 --- a/ridljar/com/sun/star/uno/Union.java +++ b/ridljar/com/sun/star/uno/Union.java @@ -22,7 +22,7 @@ package com.sun.star.uno; * The Union class is the base class for all classes generated * as java binding for the IDL type union. * <p> - * Note: The idl type <code>union<code> is currently not fully + * Note: The idl type <code>union</code> is currently not fully * integrated into the UNO framework, so don't use it. */ public class Union { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits