[Libreoffice-commits] core.git: framework/inc framework/source framework/util include/framework sfx2/source
framework/inc/helper/mischelper.hxx |2 + framework/source/fwe/classes/sfxhelperfunctions.cxx |3 + framework/source/fwi/helper/mischelper.cxx |4 +- framework/source/services/ContextChangeEventMultiplexer.cxx | 24 +++- framework/util/fwk.component|3 + include/framework/ContextChangeEventMultiplexerTunnel.hxx |2 + sfx2/source/sidebar/SidebarController.cxx |4 +- 7 files changed, 20 insertions(+), 22 deletions(-) New commits: commit a9493229bb453a8f437c45d838777e2ba8217b76 Author: Noel Grandin AuthorDate: Sun Mar 21 13:41:39 2021 +0200 Commit: Noel Grandin CommitDate: Tue Mar 23 09:33:43 2021 +0100 use single-use attribute for ContextChangeEventMultiplexer instead of rtl::Instance, which means it will get cleaned up when UNO shuts down Change-Id: I13b36f1fe570f789036ef54ecfb7d0a85ce1450c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112842 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx index 4dcb94003449..d05ae360a082 100644 --- a/framework/inc/helper/mischelper.hxx +++ b/framework/inc/helper/mischelper.hxx @@ -246,10 +246,12 @@ class WeakDocumentEventListener final : public ::cppu::WeakImplHelper GetFirstListenerWith_Impl( +css::uno::Reference const & xComponentContext, css::uno::Reference const& xEventFocus, std::function const&)> const& rPredicate); extern auto (*g_pGetMultiplexerListener)( +css::uno::Reference const & xComponentContext, css::uno::Reference const&, std::function const&)> const&) -> css::uno::Reference; diff --git a/framework/source/fwe/classes/sfxhelperfunctions.cxx b/framework/source/fwe/classes/sfxhelperfunctions.cxx index e456a7a42460..9adc5931a7e3 100644 --- a/framework/source/fwe/classes/sfxhelperfunctions.cxx +++ b/framework/source/fwe/classes/sfxhelperfunctions.cxx @@ -146,10 +146,11 @@ bool IsDockingWindowVisible( const css::uno::Reference< css::frame::XFrame >& rF using namespace ::com::sun::star; uno::Reference GetFirstListenerWith( +css::uno::Reference const & xComponentContext, uno::Reference const& xEventFocus, std::function const&)> const& rPredicate) { -return GetFirstListenerWith_Impl(xEventFocus, rPredicate); +return GetFirstListenerWith_Impl(xComponentContext, xEventFocus, rPredicate); } } diff --git a/framework/source/fwi/helper/mischelper.cxx b/framework/source/fwi/helper/mischelper.cxx index b53cd0f2672d..e9c664d474df 100644 --- a/framework/source/fwi/helper/mischelper.cxx +++ b/framework/source/fwi/helper/mischelper.cxx @@ -133,17 +133,19 @@ void FillLangItems( std::set< OUString > &rLangItems, } auto (*g_pGetMultiplexerListener)( +css::uno::Reference const & xComponentContext, uno::Reference const&, std::function const&)> const&) -> uno::Reference = nullptr; uno::Reference GetFirstListenerWith_Impl( +css::uno::Reference const & xComponentContext, uno::Reference const& xEventFocus, std::function const&)> const& rPredicate) { assert(g_pGetMultiplexerListener != nullptr); // should not be called too early, nor too late -return g_pGetMultiplexerListener(xEventFocus, rPredicate); +return g_pGetMultiplexerListener(xComponentContext, xEventFocus, rPredicate); } diff --git a/framework/source/services/ContextChangeEventMultiplexer.cxx b/framework/source/services/ContextChangeEventMultiplexer.cxx index fe24c2b6d770..3e647985cb40 100644 --- a/framework/source/services/ContextChangeEventMultiplexer.cxx +++ b/framework/source/services/ContextChangeEventMultiplexer.cxx @@ -23,11 +23,13 @@ #include #include #include +#include #include #include #include #include +#include #include #include @@ -324,34 +326,21 @@ void SAL_CALL ContextChangeEventMultiplexer::disposing ( const css::lang::EventO maListeners.erase(iDescriptor); } -struct Instance { -explicit Instance(): -instance(static_cast( -new ContextChangeEventMultiplexer())) -{ -} - -css::uno::Reference instance; -}; - -struct Singleton: -public rtl::Static -{}; - } namespace framework { // right now we assume there's one matching listener static uno::Reference GetFirstListenerWith_ImplImpl( +css::uno::Reference const & xComponentContext, uno::Reference const& xEventFocus, std::function const&)> const& rPredicate) { assert(xEventFocus.is()); // in current usage it's a bug if the XController is null here uno::Reference xRet; -ContextChangeEventMultiplexer *const pMultiplexer( -dynamic_cast(Singleton::get().instance.get())); +rtl::Reference pMultiplexer = +dynamic_cast(ui::ContextChangeEventMultiplexer::get(xComponentContext).get()); assert(pMultiplexer); ContextCh
[Libreoffice-commits] core.git: framework/inc framework/source framework/util officecfg/registry
framework/inc/menuconfiguration.hxx |2 framework/inc/uielement/menubarmanager.hxx |1 framework/source/uielement/menubarmanager.cxx | 227 ++ framework/source/uielement/resourcemenucontroller.cxx | 161 +++ framework/util/fwk.component|4 officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu | 11 6 files changed, 230 insertions(+), 176 deletions(-) New commits: commit 3a46e402adfd8e0ac1f162de382e03ba92842bcb Author: Maxim Monastirsky AuthorDate: Wed Aug 26 14:00:50 2020 +0300 Commit: Maxim Monastirsky CommitDate: Fri Aug 28 00:17:07 2020 +0200 MenuBarManager: Extract the window list to own controller Change-Id: Iad3df8cfe0814f510effaac2b7ba6dd926baab7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101476 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky diff --git a/framework/inc/menuconfiguration.hxx b/framework/inc/menuconfiguration.hxx index 0c8ae43545bd..84943f5326a6 100644 --- a/framework/inc/menuconfiguration.hxx +++ b/framework/inc/menuconfiguration.hxx @@ -29,8 +29,6 @@ namespace com::sun::star::io { class XInputStream; } namespace com::sun::star::io { class XOutputStream; } namespace com::sun::star::uno { class XComponentContext; } -const sal_uInt16 START_ITEMID_WINDOWLIST= 4600; -const sal_uInt16 END_ITEMID_WINDOWLIST = 4699; const sal_uInt16 ITEMID_ADDONLIST = 6678; // used to be a SID in sfx2, now just a unique id... namespace framework diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index 4fa42c8e8fd1..698b46341579 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -162,7 +162,6 @@ class MenuBarManager final : }; void RetrieveShortcuts( std::vector< std::unique_ptr >& aMenuShortCuts ); -static void UpdateSpecialWindowMenu( Menu* pMenu, const css::uno::Reference< css::uno::XComponentContext >& xContext ); static void FillMenuImages( css::uno::Reference< css::frame::XFrame > const & xFrame, Menu* _pMenu, bool bShowMenuImages ); static void impl_RetrieveShortcutsFromConfiguration( const css::uno::Reference< css::ui::XAcceleratorConfiguration >& rAccelCfg, const css::uno::Sequence< OUString >& rCommands, diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index 5359bc712f53..eb3fe530acce 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -51,10 +50,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -615,9 +612,6 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool ) m_bActive = true; -if ( m_aMenuItemCommand == aSpecialWindowCommand ) -UpdateSpecialWindowMenu( pMenu, m_xContext ); - // Check if some modes have changed so we have to update our menu images OUString sIconTheme = SvtMiscOptions().GetIconTheme(); @@ -687,64 +681,57 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool ) if ( !menuItemHandler->xMenuItemDispatch.is() && !menuItemHandler->xSubMenuManager.is() ) { -// There is no dispatch mechanism for the special window list menu items, -// because they are handled directly through XFrame->activate!!! -// Don't update dispatches for special file menu items. -if ( menuItemHandler->nItemId < START_ITEMID_WINDOWLIST || - menuItemHandler->nItemId >= END_ITEMID_WINDOWLIST ) -{ -Reference< XDispatch > xMenuItemDispatch; +Reference< XDispatch > xMenuItemDispatch; -aTargetURL.Complete = menuItemHandler->aMenuItemURL; +aTargetURL.Complete = menuItemHandler->aMenuItemURL; -m_xURLTransformer->parseStrict( aTargetURL ); +m_xURLTransformer->parseStrict( aTargetURL ); -if ( bHasDisabledEntries ) -{ -if ( aCmdOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED, aTargetURL.Path )) -pMenu->HideItem( menuItemHandler->nItemId ); -} +if ( bHasDisabledEntries ) +{ +if ( aCmdOptio
[Libreoffice-commits] core.git: framework/inc framework/source framework/util
framework/inc/dispatch/mailtodispatcher.hxx | 10 +-- framework/inc/recording/dispatchrecordersupplier.hxx| 13 +--- framework/inc/services.h|8 -- framework/inc/services/mediatypedetectionhelper.hxx | 27 + framework/inc/uielement/fontmenucontroller.hxx | 10 +-- framework/inc/uielement/fontsizemenucontroller.hxx | 10 +-- framework/inc/uielement/footermenucontroller.hxx| 15 + framework/inc/uielement/headermenucontroller.hxx| 10 +-- framework/inc/uielement/macrosmenucontroller.hxx| 10 +-- framework/source/dispatch/mailtodispatcher.cxx | 36 +++- framework/source/recording/dispatchrecordersupplier.cxx | 45 framework/source/register/registertemp.cxx |8 -- framework/source/services/mediatypedetectionhelper.cxx | 35 framework/source/uielement/fontmenucontroller.cxx | 28 +++-- framework/source/uielement/fontsizemenucontroller.cxx | 26 +++-- framework/source/uielement/footermenucontroller.cxx | 28 - framework/source/uielement/headermenucontroller.cxx | 28 +++-- framework/source/uielement/macrosmenucontroller.cxx | 30 -- framework/util/fwk.component| 24 +--- 19 files changed, 230 insertions(+), 171 deletions(-) New commits: commit 1a90b1aa64866950cf9ad7032a8240b0c072e671 Author: Noel Grandin AuthorDate: Wed Jul 8 18:13:39 2020 +0200 Commit: Noel Grandin CommitDate: Wed Jul 8 21:12:50 2020 +0200 framework: create instances with uno constructors See tdf#74608 for motivation Change-Id: I6237016000dc05eacb14e59815b53cd44fbfce0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98384 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/inc/dispatch/mailtodispatcher.hxx b/framework/inc/dispatch/mailtodispatcher.hxx index a830822cde81..e76fadfb6b2b 100644 --- a/framework/inc/dispatch/mailtodispatcher.hxx +++ b/framework/inc/dispatch/mailtodispatcher.hxx @@ -61,12 +61,10 @@ class MailToDispatcher final : public ::cppu::WeakImplHelper< MailToDispatcher( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); virtual ~MailToDispatcher( ) override; -// XInterface, XTypeProvider, XServiceInfo -DECLARE_XSERVICEINFO_NOFACTORY -/* Helper for registry */ -/// @throws css::uno::Exception -static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); -static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); +/* interface XServiceInfo */ +virtual OUString SAL_CALL getImplementationName() override; +virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; +virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XDispatchProvider virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL, diff --git a/framework/inc/recording/dispatchrecordersupplier.hxx b/framework/inc/recording/dispatchrecordersupplier.hxx index b8eb844dbd1d..83517137df98 100644 --- a/framework/inc/recording/dispatchrecordersupplier.hxx +++ b/framework/inc/recording/dispatchrecordersupplier.hxx @@ -59,13 +59,10 @@ class DispatchRecorderSupplier final : public ::cppu::WeakImplHelper< public: -// XInterface, XTypeProvider, XServiceInfo - -DECLARE_XSERVICEINFO_NOFACTORY -/* Helper for registry */ -/// @throws css::uno::Exception -static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); -static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); +/* interface XServiceInfo */ +virtual OUString SAL_CALL getImplementationName() override; +virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; +virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XDispatchRecorderSupplier @@ -79,7 +76,7 @@ class DispatchRecorderSupplier final : public ::cppu::WeakImplHelper< public: - DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMult
[Libreoffice-commits] core.git: framework/inc framework/source framework/util include/framework
framework/inc/dispatch/oxt_handler.hxx | 15 +- framework/inc/dispatch/popupmenudispatcher.hxx | 10 - framework/inc/dispatch/servicehandler.hxx| 14 +- framework/inc/dispatch/systemexec.hxx| 10 - framework/inc/jobs/helponstartup.hxx | 10 - framework/inc/jobs/shelljob.hxx | 10 - framework/inc/services.h | 12 -- framework/inc/services/uriabbreviation.hxx |9 - framework/inc/uielement/newmenucontroller.hxx| 10 - framework/inc/uielement/toolbarmodemenucontroller.hxx| 10 - framework/inc/uielement/toolbarsmenucontroller.hxx | 10 - framework/source/dispatch/dispatchdisabler.cxx | 28 - framework/source/dispatch/oxt_handler.cxx| 39 --- framework/source/dispatch/popupmenudispatcher.cxx| 58 +- framework/source/dispatch/servicehandler.cxx | 46 framework/source/dispatch/systemexec.cxx | 35 +++--- framework/source/inc/dispatch/dispatchdisabler.hxx |9 - framework/source/jobs/helponstartup.cxx | 81 --- framework/source/jobs/shelljob.cxx | 38 --- framework/source/register/registertemp.cxx | 14 -- framework/source/services/dispatchhelper.cxx | 24 +++- framework/source/services/uriabbreviation.cxx| 31 +++-- framework/source/uielement/newmenucontroller.cxx | 27 +++-- framework/source/uielement/toolbarmodemenucontroller.cxx | 29 - framework/source/uielement/toolbarsmenucontroller.cxx| 28 - framework/util/fwk.component | 36 -- include/framework/dispatchhelper.hxx | 12 -- 27 files changed, 354 insertions(+), 301 deletions(-) New commits: commit 71227e2306987cb8aa5fbda2943e73237674e9ba Author: Noel Grandin AuthorDate: Tue Jul 7 20:02:18 2020 +0200 Commit: Noel Grandin CommitDate: Tue Jul 7 22:13:02 2020 +0200 framework: create instances with uno constructors See tdf#74608 for motivation Change-Id: I8679b50395d11cb2d807d52526d803df9b0606b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98294 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/framework/inc/dispatch/oxt_handler.hxx b/framework/inc/dispatch/oxt_handler.hxx index 69bc07074c3e..bc9c24070cde 100644 --- a/framework/inc/dispatch/oxt_handler.hxx +++ b/framework/inc/dispatch/oxt_handler.hxx @@ -52,16 +52,13 @@ class Oxt_Handler final : public ::cppu::WeakImplHelper< public: - Oxt_Handler( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory ); + Oxt_Handler( const css::uno::Reference< css::uno::XComponentContext >& ); virtual ~Oxt_Handler( ) override; -// XInterface, XTypeProvider, XServiceInfo - -DECLARE_XSERVICEINFO_NOFACTORY -/* Helper for registry */ -/// @throws css::uno::Exception -static css::uno::Reference< css::uno::XInterface > SAL_CALL impl_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); -static css::uno::Reference< css::lang::XSingleServiceFactory > impl_createFactory ( const css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager ); +/* interface XServiceInfo */ +virtual OUString SAL_CALL getImplementationName() override; +virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; +virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; // XNotifyingDispatch @@ -85,7 +82,7 @@ class Oxt_Handler final : public ::cppu::WeakImplHelper< private: osl::Mutex m_mutex; -css::uno::Reference< css::lang::XMultiServiceFactory > m_xFactory; /// global uno service factory to create new services +css::uno::Reference< css::uno::XComponentContext > m_xContext; /// global uno service factory to create new services }; diff --git a/framework/inc/dispatch/popupmenudispatcher.hxx b/framework/inc/dispatch/popupmenudispatcher.hxx index 869ee956e4a4..845e5c92592d 100644 --- a/framework/inc/dispatch/popupmenudispatcher.hxx +++ b/framework/inc/dispatch/popupmenudispatcher.hxx @@ -68,12 +68,10 @@ class PopupMenuDispatcher final : public ::cppu::WeakImplHelper< // constructor / destructor PopupMenuDispatcher( const css::uno::Reference< css::uno::XComponentContext >& xContext ); -// XInterface, XTypeProvider, XServiceInfo -DECLARE_XSERVICEINFO_NOFACTORY -/* Helper for registry */ -/// @throws css::uno::Excepti
[Libreoffice-commits] core.git: framework/inc framework/source framework/util
framework/inc/jobs/jobexecutor.hxx | 115 --- framework/source/jobs/jobexecutor.cxx | 182 + framework/source/register/registerservices.cxx |2 framework/util/fwk.component |3 4 files changed, 133 insertions(+), 169 deletions(-) New commits: commit 748aa84e9808ad31c6ff6b71459525c82de10e58 Author: Matúš Kukan Date: Thu Jan 9 20:41:58 2014 +0100 fwk: Use constructor feature for JobExecutor. Change-Id: I5087320137dc17f27a382d564a59cec68f1a4f95 diff --git a/framework/inc/jobs/jobexecutor.hxx b/framework/inc/jobs/jobexecutor.hxx deleted file mode 100644 index d4ed3c3..000 --- a/framework/inc/jobs/jobexecutor.hxx +++ /dev/null @@ -1,115 +0,0 @@ -/* -*- 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_FRAMEWORK_INC_JOBS_JOBEXECUTOR_HXX -#define INCLUDED_FRAMEWORK_INC_JOBS_JOBEXECUTOR_HXX - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -namespace framework{ - - -//___ -/** -@short implements a job executor, which can be triggered from any code -@descr It uses the given trigger event to locate any registered job service -inside the configuration and execute it. Of course it controls the -liftime of such jobs too. - */ -class JobExecutor : private ThreadHelpBase - , public ::cppu::WeakImplHelper4< -css::lang::XServiceInfo - , css::task::XJobExecutor - , css::container::XContainerListener // => lang.XEventListener - , css::document::XEventListener > -{ -//___ -// member - -private: - -/** reference to the uno service manager */ -css::uno::Reference< css::uno::XComponentContext > m_xContext; - -/** reference to the module info service */ -css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager; - -/** cached list of all registered event names of cfg for call optimization. */ -OUStringList m_lEvents; - -/** we listen at the configuration for changes at the event list. */ -ConfigAccess m_aConfig; - -/** helper to allow us listen to the configuration without a cyclic dependency */ - com::sun::star::uno::Reference m_xConfigListener; - -//___ -// native interface methods - -public: - - JobExecutor( const css::uno::Reference< css::uno::XComponentContext >& xContext ); - virtual ~JobExecutor( ); - -//___ -// uno interface methods - -public: - -// XInterface, XTypeProvider, XServiceInfo -DECLARE_XSERVICEINFO - -// task.XJobExecutor -virtual void SAL_CALL trigger( const OUString& sEvent ) throw(css::uno::RuntimeException); - -// document.XEventListener -virtual void SAL_CALL notifyEvent( const css::document::EventObject& aEvent ) throw(css::uno::RuntimeException); - -// container.XContainerListener -virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& aEvent ) throw(css::uno::RuntimeException); -virtual void SAL_CALL elementRemoved ( const css::container::ContainerEvent& aEvent ) throw(css::uno::RuntimeException); -virtual void SAL_CALL elementReplaced( const css::container::ContainerEvent& aEvent ) throw(css::uno::RuntimeException); - -// lang.XEventListener -virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException); -}; - -} // namespace framework - -#endif // INCLUDED_FRAMEWORK_INC_JOBS_JOBEXECUTOR_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/jobs/jobexecutor.cxx b/framework/sour