diff options
Diffstat (limited to 'framework/inc')
84 files changed, 409 insertions, 523 deletions
diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h index e75b5be04b02..667dc06c07e8 100644 --- a/framework/inc/acceleratorconst.h +++ b/framework/inc/acceleratorconst.h @@ -19,13 +19,13 @@ #pragma once -namespace framework{ +#include <rtl/ustring.hxx> -#define ATTRIBUTE_TYPE_CDATA "CDATA" +namespace framework{ // same items with a name space alias -#define AL_ELEMENT_ACCELERATORLIST "accel:acceleratorlist" -#define AL_ELEMENT_ITEM "accel:item" +inline constexpr OUString AL_ELEMENT_ACCELERATORLIST = u"accel:acceleratorlist"_ustr; +inline constexpr OUString AL_ELEMENT_ITEM = u"accel:item"_ustr; } // namespace framework diff --git a/framework/inc/addonmenu.hxx b/framework/inc/addonmenu.hxx index 461f81af2fc6..d6f244cdca4a 100644 --- a/framework/inc/addonmenu.hxx +++ b/framework/inc/addonmenu.hxx @@ -41,7 +41,7 @@ class AddonMenuManager static bool HasAddonMenuElements(); // Check if the context string matches the provided xModel context - static bool IsCorrectContext(std::u16string_view rModuleIdentifier, const OUString& rContext); + static bool IsCorrectContext(std::u16string_view rModuleIdentifier, std::u16string_view rContext); // Create the Add-Ons menu static VclPtr<PopupMenu> CreateAddonMenu( const css::uno::Reference< css::frame::XFrame >& rFrame ); diff --git a/framework/inc/bitmaps.hlst b/framework/inc/bitmaps.hlst index e65566982d06..986005bbdc40 100644 --- a/framework/inc/bitmaps.hlst +++ b/framework/inc/bitmaps.hlst @@ -9,29 +9,31 @@ #pragma once -#define BMP_SAVEMODIFIED_SMALL "res/savemodified_small.png" -#define BMP_SAVEMODIFIED_LARGE "res/savemodified_large.png" -#define BMP_SAVEMODIFIED_EXTRALARGE "res/savemodified_extralarge.png" +#include <rtl/ustring.hxx> -#define RID_SVXBMP_BUTTON "res/sx10594.png" -#define RID_SVXBMP_RADIOBUTTON "res/sx10595.png" -#define RID_SVXBMP_CHECKBOX "res/sx10596.png" -#define RID_SVXBMP_FIXEDTEXT "res/sx10597.png" -#define RID_SVXBMP_GROUPBOX "res/sx10598.png" -#define RID_SVXBMP_EDITBOX "res/sx10599.png" -#define RID_SVXBMP_LISTBOX "res/sx10600.png" -#define RID_SVXBMP_COMBOBOX "res/sx10601.png" -#define RID_SVXBMP_IMAGEBUTTON "res/sx10604.png" -#define RID_SVXBMP_IMAGECONTROL "res/sx10710.png" -#define RID_SVXBMP_FILECONTROL "res/sx10605.png" -#define RID_SVXBMP_DATEFIELD "res/sx10704.png" -#define RID_SVXBMP_TIMEFIELD "res/sx10705.png" -#define RID_SVXBMP_NUMERICFIELD "res/sx10706.png" -#define RID_SVXBMP_CURRENCYFIELD "res/sx10707.png" -#define RID_SVXBMP_PATTERNFIELD "res/sx10708.png" -#define RID_SVXBMP_FORMATTEDFIELD "res/sx10728.png" -#define RID_SVXBMP_SCROLLBAR "res/sx10768.png" -#define RID_SVXBMP_SPINBUTTON "res/sx10769.png" -#define RID_SVXBMP_NAVIGATIONBAR "res/sx10607.png" +inline constexpr OUString BMP_SAVEMODIFIED_SMALL = u"res/savemodified_small.png"_ustr; +inline constexpr OUString BMP_SAVEMODIFIED_LARGE = u"res/savemodified_large.png"_ustr; +inline constexpr OUString BMP_SAVEMODIFIED_EXTRALARGE = u"res/savemodified_extralarge.png"_ustr; + +inline constexpr OUString RID_SVXBMP_BUTTON = u"res/sx10594.png"_ustr; +inline constexpr OUString RID_SVXBMP_RADIOBUTTON = u"res/sx10595.png"_ustr; +inline constexpr OUString RID_SVXBMP_CHECKBOX = u"res/sx10596.png"_ustr; +inline constexpr OUString RID_SVXBMP_FIXEDTEXT = u"res/sx10597.png"_ustr; +inline constexpr OUString RID_SVXBMP_GROUPBOX = u"res/sx10598.png"_ustr; +inline constexpr OUString RID_SVXBMP_EDITBOX = u"res/sx10599.png"_ustr; +inline constexpr OUString RID_SVXBMP_LISTBOX = u"res/sx10600.png"_ustr; +inline constexpr OUString RID_SVXBMP_COMBOBOX = u"res/sx10601.png"_ustr; +inline constexpr OUString RID_SVXBMP_IMAGEBUTTON = u"res/sx10604.png"_ustr; +inline constexpr OUString RID_SVXBMP_IMAGECONTROL = u"res/sx10710.png"_ustr; +inline constexpr OUString RID_SVXBMP_FILECONTROL = u"res/sx10605.png"_ustr; +inline constexpr OUString RID_SVXBMP_DATEFIELD = u"res/sx10704.png"_ustr; +inline constexpr OUString RID_SVXBMP_TIMEFIELD = u"res/sx10705.png"_ustr; +inline constexpr OUString RID_SVXBMP_NUMERICFIELD = u"res/sx10706.png"_ustr; +inline constexpr OUString RID_SVXBMP_CURRENCYFIELD = u"res/sx10707.png"_ustr; +inline constexpr OUString RID_SVXBMP_PATTERNFIELD = u"res/sx10708.png"_ustr; +inline constexpr OUString RID_SVXBMP_FORMATTEDFIELD = u"res/sx10728.png"_ustr; +inline constexpr OUString RID_SVXBMP_SCROLLBAR = u"res/sx10768.png"_ustr; +inline constexpr OUString RID_SVXBMP_SPINBUTTON = u"res/sx10769.png"_ustr; +inline constexpr OUString RID_SVXBMP_NAVIGATIONBAR = u"res/sx10607.png"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/framework/inc/classes/actiontriggercontainer.hxx b/framework/inc/classes/actiontriggercontainer.hxx index 785fa2511943..25511d52b357 100644 --- a/framework/inc/classes/actiontriggercontainer.hxx +++ b/framework/inc/classes/actiontriggercontainer.hxx @@ -24,8 +24,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#define SERVICENAME_ACTIONTRIGGERCONTAINER "com.sun.star.ui.ActionTriggerContainer" -#define IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER "com.sun.star.comp.ui.ActionTriggerContainer" +inline constexpr OUString SERVICENAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.ui.ActionTriggerContainer"_ustr; +inline constexpr OUString IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.ActionTriggerContainer"_ustr; namespace framework { diff --git a/framework/inc/classes/actiontriggerpropertyset.hxx b/framework/inc/classes/actiontriggerpropertyset.hxx index 59c883cf8841..9ac0170b072f 100644 --- a/framework/inc/classes/actiontriggerpropertyset.hxx +++ b/framework/inc/classes/actiontriggerpropertyset.hxx @@ -28,8 +28,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#define SERVICENAME_ACTIONTRIGGER "com.sun.star.ui.ActionTrigger" -#define IMPLEMENTATIONNAME_ACTIONTRIGGER "com.sun.star.comp.ui.ActionTrigger" +inline constexpr OUString SERVICENAME_ACTIONTRIGGER = u"com.sun.star.ui.ActionTrigger"_ustr; +inline constexpr OUString IMPLEMENTATIONNAME_ACTIONTRIGGER = u"com.sun.star.comp.ui.ActionTrigger"_ustr; namespace framework { @@ -82,19 +82,19 @@ class ActionTriggerPropertySet final : private cppu::BaseMutex, // helper /// @throws css::lang::IllegalArgumentException - bool impl_tryToChangeProperty( const OUString& aCurrentValue , + static bool impl_tryToChangeProperty( const OUString& aCurrentValue , const css::uno::Any& aNewValue , css::uno::Any& aOldValue , css::uno::Any& aConvertedValue ); /// @throws css::lang::IllegalArgumentException - bool impl_tryToChangeProperty( const css::uno::Reference< css::awt::XBitmap >& xBitmap, + static bool impl_tryToChangeProperty( const css::uno::Reference< css::awt::XBitmap >& xBitmap, const css::uno::Any& aNewValue , css::uno::Any& aOldValue , css::uno::Any& aConvertedValue ); /// @throws css::lang::IllegalArgumentException - bool impl_tryToChangeProperty( const css::uno::Reference< css::uno::XInterface >& xInterface, + static bool impl_tryToChangeProperty( const css::uno::Reference< css::uno::XInterface >& xInterface, const css::uno::Any& aNewValue , css::uno::Any& aOldValue , css::uno::Any& aConvertedValue ); diff --git a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx index 198fa2f8393c..25d9084a1fb5 100644 --- a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx +++ b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx @@ -26,8 +26,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#define SERVICENAME_ACTIONTRIGGERSEPARATOR "com.sun.star.ui.ActionTriggerSeparator" -#define IMPLEMENTATIONNAME_ACTIONTRIGGERSEPARATOR "com.sun.star.comp.ui.ActionTriggerSeparator" +inline constexpr OUString SERVICENAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.ui.ActionTriggerSeparator"_ustr; +inline constexpr OUString IMPLEMENTATIONNAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.comp.ui.ActionTriggerSeparator"_ustr; namespace framework { @@ -81,7 +81,7 @@ class ActionTriggerSeparatorPropertySet final : private cppu::BaseMutex, /// @throws css::lang::IllegalArgumentException /// @throws css::uno::RuntimeException - bool impl_tryToChangeProperty( sal_Int16 aCurrentValue , + static bool impl_tryToChangeProperty( sal_Int16 aCurrentValue , const css::uno::Any& aNewValue , css::uno::Any& aOldValue , css::uno::Any& aConvertedValue ); diff --git a/framework/inc/classes/imagewrapper.hxx b/framework/inc/classes/imagewrapper.hxx deleted file mode 100644 index eea43c4e0394..000000000000 --- a/framework/inc/classes/imagewrapper.hxx +++ /dev/null @@ -1,58 +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 . - */ - -#pragma once - -#include <com/sun/star/awt/XBitmap.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <cppuhelper/implbase.hxx> -#include <vcl/image.hxx> - -namespace framework -{ - -class ImageWrapper final : public ::cppu::WeakImplHelper< css::awt::XBitmap, - css::lang::XUnoTunnel > -{ - public: - ImageWrapper( const Image& aImage ); - virtual ~ImageWrapper() override; - - const Image& GetImage() const - { - return m_aImage; - } - - static css::uno::Sequence<sal_Int8> const& getUnoTunnelId(); - - // XBitmap - virtual css::awt::Size SAL_CALL getSize() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getDIB() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getMaskDIB() override; - - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - - private: - Image m_aImage; -}; - -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx index 25e315025dc3..9ecb06abda13 100644 --- a/framework/inc/classes/protocolhandlercache.hxx +++ b/framework/inc/classes/protocolhandlercache.hxx @@ -29,7 +29,7 @@ namespace framework{ -#define PACKAGENAME_PROTOCOLHANDLER "Office.ProtocolHandler" /// name of our configuration package +inline constexpr OUString PACKAGENAME_PROTOCOLHANDLER = u"Office.ProtocolHandler"_ustr; /// name of our configuration package #define CFG_PATH_SEPARATOR "/" /// separator for configuration paths @@ -105,10 +105,10 @@ class HandlerCache final HandlerCache(); ~HandlerCache(); - bool search( const OUString& sURL, ProtocolHandler* pReturn ) const; - bool search( const css::util::URL& aURL, ProtocolHandler* pReturn ) const; + static bool search( const OUString& sURL, ProtocolHandler* pReturn ); + static bool search( const css::util::URL& aURL, ProtocolHandler* pReturn ); - void takeOver(HandlerHash aHandler, PatternHash aPattern); + static void takeOver(HandlerHash aHandler, PatternHash aPattern); }; /** diff --git a/framework/inc/classes/rootactiontriggercontainer.hxx b/framework/inc/classes/rootactiontriggercontainer.hxx index 151a7c7338d4..87ba5b518fd1 100644 --- a/framework/inc/classes/rootactiontriggercontainer.hxx +++ b/framework/inc/classes/rootactiontriggercontainer.hxx @@ -20,14 +20,13 @@ #pragma once #include <helper/propertysetcontainer.hxx> -#include <vcl/menu.hxx> +#include <com/sun/star/awt/XPopupMenu.hpp> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#define IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER "com.sun.star.comp.ui.RootActionTriggerContainer" +inline constexpr OUString IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.RootActionTriggerContainer"_ustr; namespace framework { @@ -35,12 +34,11 @@ namespace framework class RootActionTriggerContainer final : public PropertySetContainer, public css::lang::XMultiServiceFactory, public css::lang::XServiceInfo, - public css::lang::XUnoTunnel, public css::lang::XTypeProvider, public css::container::XNamed { public: - RootActionTriggerContainer( const Menu* pMenu, const OUString* pMenuIdentifier); + RootActionTriggerContainer(css::uno::Reference<css::awt::XPopupMenu> xMenu, const OUString* pMenuIdentifier); virtual ~RootActionTriggerContainer() override; // XInterface @@ -76,10 +74,6 @@ class RootActionTriggerContainer final : public PropertySetContainer, virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static const css::uno::Sequence<sal_Int8>& getUnoTunnelId() noexcept; - // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override; @@ -92,7 +86,7 @@ class RootActionTriggerContainer final : public PropertySetContainer, void FillContainer(); bool m_bContainerCreated; - VclPtr<const Menu> m_pMenu; + css::uno::Reference<css::awt::XPopupMenu> m_xMenu; const OUString* m_pMenuIdentifier; }; diff --git a/framework/inc/classes/taskcreator.hxx b/framework/inc/classes/taskcreator.hxx index d1535509cf67..d57cc406e3b7 100644 --- a/framework/inc/classes/taskcreator.hxx +++ b/framework/inc/classes/taskcreator.hxx @@ -48,7 +48,7 @@ class TaskCreator final // interface public: - TaskCreator( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + TaskCreator( css::uno::Reference< css::uno::XComponentContext > xContext ); ~TaskCreator( ); css::uno::Reference< css::frame::XFrame > createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ); diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx index 8ee08ed194f3..2217afa9c8d7 100644 --- a/framework/inc/dispatch/closedispatcher.hxx +++ b/framework/inc/dispatch/closedispatcher.hxx @@ -115,9 +115,9 @@ class CloseDispatcher final : public ::cppu::WeakImplHelper< @param sTarget help us to find the right target for this close operation. */ - CloseDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext , + CloseDispatcher(css::uno::Reference< css::uno::XComponentContext > xContext , const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget); + std::u16string_view sTarget); /** @short does nothing real. */ virtual ~CloseDispatcher() override; @@ -252,7 +252,7 @@ class CloseDispatcher final : public ::cppu::WeakImplHelper< */ static css::uno::Reference< css::frame::XFrame > static_impl_searchRightTargetFrame(const css::uno::Reference< css::frame::XFrame >& xFrame , - const OUString& sTarget); + std::u16string_view sTarget); }; // class CloseDispatcher diff --git a/framework/inc/dispatch/dispatchinformationprovider.hxx b/framework/inc/dispatch/dispatchinformationprovider.hxx index 3f8a689ead85..e5bdeddc1f97 100644 --- a/framework/inc/dispatch/dispatchinformationprovider.hxx +++ b/framework/inc/dispatch/dispatchinformationprovider.hxx @@ -43,8 +43,8 @@ class DispatchInformationProvider final : public ::cppu::WeakImplHelper< css::f // interface public: - DispatchInformationProvider(const css::uno::Reference< css::uno::XComponentContext >& xContext , - const css::uno::Reference< css::frame::XFrame >& xFrame); + DispatchInformationProvider(css::uno::Reference< css::uno::XComponentContext > xContext , + const css::uno::Reference< css::frame::XFrame >& xFrame); virtual ~DispatchInformationProvider() override; diff --git a/framework/inc/dispatch/dispatchprovider.hxx b/framework/inc/dispatch/dispatchprovider.hxx index 804df44abc0c..456b1f0e2a59 100644 --- a/framework/inc/dispatch/dispatchprovider.hxx +++ b/framework/inc/dispatch/dispatchprovider.hxx @@ -74,18 +74,22 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< css::frame::XDispa css::uno::WeakReference< css::frame::XFrame > m_xFrame; /// cache of some other dispatch provider which are registered inside configuration to handle special URL protocols HandlerCache m_aProtocolHandlerCache; + std::unordered_map<OUString, css::uno::Reference<css::frame::XDispatchProvider>> + m_aProtocolHandlers; /* interface */ public: - DispatchProvider( const css::uno::Reference< css::uno::XComponentContext >& xContext , - const css::uno::Reference< css::frame::XFrame >& xFrame ); + DispatchProvider( css::uno::Reference< css::uno::XComponentContext > xContext , + const css::uno::Reference< css::frame::XFrame >& xFrame ); virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch ( const css::util::URL& aURL , const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) override; virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) override; + void ClearProtocolHandlers() { m_aProtocolHandlers.clear(); } + /* helper */ private: // Let him protected! So nobody can use us as base ... @@ -95,7 +99,7 @@ class DispatchProvider final : public ::cppu::WeakImplHelper< css::frame::XDispa const css::uno::Reference< css::frame::XFrame >& xOwner , const OUString& sTarget = OUString() , sal_Int32 nSearchFlags = 0 ); - bool implts_isLoadableContent ( const css::util::URL& aURL ); + static bool implts_isLoadableContent ( const css::util::URL& aURL ); css::uno::Reference< css::frame::XDispatch > implts_queryDesktopDispatch ( const css::uno::Reference< css::frame::XFrame >& xDesktop , const css::util::URL& aURL , const OUString& sTargetFrameName , diff --git a/framework/inc/dispatch/interceptionhelper.hxx b/framework/inc/dispatch/interceptionhelper.hxx index 7788559c7eff..89339b1f8455 100644 --- a/framework/inc/dispatch/interceptionhelper.hxx +++ b/framework/inc/dispatch/interceptionhelper.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/DispatchDescriptor.hpp> +#include <rtl/ref.hxx> #include <tools/wldcrd.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/weakref.hxx> @@ -35,6 +36,8 @@ namespace framework{ +class DispatchProvider; + /** @short implements a helper to support interception with additional functionality. @descr This helper implements the complete XDispatchProviderInterception interface with @@ -97,23 +100,19 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper< /** @short search for an interceptor inside this list using it's reference. - @param xInterceptor - points to the interceptor object, which should be located inside this list. + @param sURL + URL which should match with a registered pattern. @return An iterator object, which points directly to the located item inside this list. In case no interceptor could be found, it points to the end of this list! */ iterator findByPattern(std::u16string_view sURL) { - iterator pIt; - for (pIt=begin(); pIt!=end(); ++pIt) + for (iterator pIt=begin(); pIt!=end(); ++pIt) { - sal_Int32 c = pIt->lURLPattern.getLength(); - const OUString* pPattern = pIt->lURLPattern.getConstArray(); - - for (sal_Int32 i=0; i<c; ++i) + for (const OUString& pattern : pIt->lURLPattern) { - WildCard aPattern(pPattern[i]); + WildCard aPattern(pattern); if (aPattern.Matches(sURL)) return pIt; } @@ -133,7 +132,7 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper< /** @short this interception helper implements the top level master of an interceptor list ... but this member is the lowest possible slave! */ - css::uno::Reference< css::frame::XDispatchProvider > m_xSlave; + rtl::Reference< DispatchProvider > m_xSlave; /** @short contains all registered interceptor objects. */ InterceptorList m_lInterceptionRegs; @@ -151,7 +150,7 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper< an outside creates dispatch provider, which has to be used here as lowest slave "interceptor". */ InterceptionHelper(const css::uno::Reference< css::frame::XFrame >& xOwner, - const css::uno::Reference< css::frame::XDispatchProvider >& xSlave); + rtl::Reference< DispatchProvider > xSlave); private: @@ -248,6 +247,8 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper< */ virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override; + rtl::Reference<DispatchProvider> GetSlave() const { return m_xSlave; } + }; // class InterceptionHelper } // namespace framework diff --git a/framework/inc/dispatch/mailtodispatcher.hxx b/framework/inc/dispatch/mailtodispatcher.hxx index b354cd08353a..d6fe52d93b84 100644 --- a/framework/inc/dispatch/mailtodispatcher.hxx +++ b/framework/inc/dispatch/mailtodispatcher.hxx @@ -57,7 +57,7 @@ class MailToDispatcher final : public ::cppu::WeakImplHelper< public: // ctor/dtor - MailToDispatcher( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + MailToDispatcher( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~MailToDispatcher( ) override; /* interface XServiceInfo */ diff --git a/framework/inc/dispatch/oxt_handler.hxx b/framework/inc/dispatch/oxt_handler.hxx index 162821bc1aa8..09b80ea8caba 100644 --- a/framework/inc/dispatch/oxt_handler.hxx +++ b/framework/inc/dispatch/oxt_handler.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> +#include <mutex> namespace framework{ @@ -50,7 +51,7 @@ class Oxt_Handler final : public ::cppu::WeakImplHelper< public: - Oxt_Handler( const css::uno::Reference< css::uno::XComponentContext >& ); + Oxt_Handler( css::uno::Reference< css::uno::XComponentContext > ); virtual ~Oxt_Handler( ) override; /* interface XServiceInfo */ @@ -78,7 +79,7 @@ class Oxt_Handler final : public ::cppu::WeakImplHelper< virtual OUString SAL_CALL detect ( css::uno::Sequence< css::beans::PropertyValue >& lDescriptor ) override; private: - osl::Mutex m_mutex; + std::mutex m_mutex; 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 3f38a6c939c8..0d22beb86477 100644 --- a/framework/inc/dispatch/popupmenudispatcher.hxx +++ b/framework/inc/dispatch/popupmenudispatcher.hxx @@ -64,7 +64,7 @@ class PopupMenuDispatcher final : public ::cppu::WeakImplHelper< public: // constructor / destructor - PopupMenuDispatcher( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + PopupMenuDispatcher( css::uno::Reference< css::uno::XComponentContext > xContext ); /* interface XServiceInfo */ virtual OUString SAL_CALL getImplementationName() override; diff --git a/framework/inc/dispatch/servicehandler.hxx b/framework/inc/dispatch/servicehandler.hxx index 35bb09d5d50d..0b1ee8ab93c7 100644 --- a/framework/inc/dispatch/servicehandler.hxx +++ b/framework/inc/dispatch/servicehandler.hxx @@ -61,7 +61,7 @@ class ServiceHandler final : public ::cppu::WeakImplHelper< public: // ctor/dtor - ServiceHandler( const css::uno::Reference< css::uno::XComponentContext >& ); + ServiceHandler( css::uno::Reference< css::uno::XComponentContext > ); virtual ~ServiceHandler( ) override; /* interface XServiceInfo */ diff --git a/framework/inc/dispatch/startmoduledispatcher.hxx b/framework/inc/dispatch/startmoduledispatcher.hxx index 712251b2b7f0..c575004d49ed 100644 --- a/framework/inc/dispatch/startmoduledispatcher.hxx +++ b/framework/inc/dispatch/startmoduledispatcher.hxx @@ -62,7 +62,7 @@ class StartModuleDispatcher final : public ::cppu::WeakImplHelper< @param xFrame the frame where the corresponding dispatch was started. */ - StartModuleDispatcher(const css::uno::Reference< css::uno::XComponentContext >& rxContext); + StartModuleDispatcher(css::uno::Reference< css::uno::XComponentContext > xContext); /** @short does nothing real. */ virtual ~StartModuleDispatcher() override; diff --git a/framework/inc/dispatch/systemexec.hxx b/framework/inc/dispatch/systemexec.hxx index 8dd7cc6fef11..8badbc1ca20c 100644 --- a/framework/inc/dispatch/systemexec.hxx +++ b/framework/inc/dispatch/systemexec.hxx @@ -59,7 +59,7 @@ class SystemExec final : public ::cppu::WeakImplHelper< public: // ctor/dtor - SystemExec( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + SystemExec( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~SystemExec( ) override; /* interface XServiceInfo */ @@ -89,7 +89,7 @@ class SystemExec final : public ::cppu::WeakImplHelper< /* internal */ private: - void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener, + static void impl_notifyResultListener(const css::uno::Reference< css::frame::XDispatchResultListener >& xListener, const sal_Int16 nState ); }; // class SystemExec diff --git a/framework/inc/helper/mischelper.hxx b/framework/inc/helper/mischelper.hxx index e7f4412a4306..04284e8ff866 100644 --- a/framework/inc/helper/mischelper.hxx +++ b/framework/inc/helper/mischelper.hxx @@ -31,11 +31,13 @@ #include <cppuhelper/weakref.hxx> #include <i18nlangtag/lang.h> +#include <o3tl/string_view.hxx> #include <svl/languageoptions.hxx> #include <rtl/ustring.hxx> #include <functional> #include <set> +#include <utility> namespace framework { @@ -81,24 +83,25 @@ inline bool IsScriptTypeMatchingToLanguage( SvtScriptType nScriptType, LanguageT return bool(nScriptType & SvtLanguageOptions::GetScriptTypeOfLanguage( nLang )); } -inline void RetrieveTypeNameFromResourceURL( const OUString& aResourceURL, OUString& aType, OUString& aName ) +inline void RetrieveTypeNameFromResourceURL( std::u16string_view aResourceURL, OUString& aType, OUString& aName ) { - static const char RESOURCEURL_PREFIX[] = "private:resource/"; - static const sal_Int32 RESOURCEURL_PREFIX_SIZE = strlen(RESOURCEURL_PREFIX); + static constexpr std::u16string_view RESOURCEURL_PREFIX = u"private:resource/"; - if (aResourceURL.startsWith( RESOURCEURL_PREFIX )) + if (o3tl::starts_with(aResourceURL, RESOURCEURL_PREFIX )) { - sal_Int32 nIdx{ RESOURCEURL_PREFIX_SIZE }; - while (nIdx<aResourceURL.getLength() && aResourceURL[nIdx]=='/') ++nIdx; - if (nIdx>=aResourceURL.getLength()) + size_t nIdx = RESOURCEURL_PREFIX.size(); + while (nIdx < aResourceURL.size() && aResourceURL[nIdx]=='/') + ++nIdx; + if (nIdx >= aResourceURL.size()) return; - aType = aResourceURL.getToken(0, '/', nIdx); - if (nIdx<0) + aType = o3tl::getToken(aResourceURL, u'/', nIdx); + if (nIdx == std::u16string_view::npos) return; - while (nIdx<aResourceURL.getLength() && aResourceURL[nIdx]=='/') ++nIdx; - if (nIdx>=aResourceURL.getLength()) + while (nIdx < aResourceURL.size() && aResourceURL[nIdx]=='/') + ++nIdx; + if (nIdx >= aResourceURL.size()) return; - aName = aResourceURL.getToken(0, '/', nIdx); + aName = o3tl::getToken(aResourceURL, u'/', nIdx); } } @@ -108,7 +111,7 @@ class LanguageGuessingHelper css::uno::Reference< css::uno::XComponentContext > m_xContext; public: - LanguageGuessingHelper(const css::uno::Reference< css::uno::XComponentContext >& _xContext) : m_xContext(_xContext){} + LanguageGuessingHelper(css::uno::Reference< css::uno::XComponentContext > _xContext) : m_xContext(std::move(_xContext)){} css::uno::Reference< css::linguistic2::XLanguageGuessing > const & GetGuesser() const; }; diff --git a/framework/inc/helper/ocomponentaccess.hxx b/framework/inc/helper/ocomponentaccess.hxx index 9c444953a042..4ca28b843463 100644 --- a/framework/inc/helper/ocomponentaccess.hxx +++ b/framework/inc/helper/ocomponentaccess.hxx @@ -135,7 +135,7 @@ class OComponentAccess final : public ::cppu::WeakImplHelper< css::container::XE and must collect all information. *//*-*****************************************************************************************************/ - void impl_collectAllChildComponents( const css::uno::Reference< css::frame::XFramesSupplier >& xNode , + static void impl_collectAllChildComponents( const css::uno::Reference< css::frame::XFramesSupplier >& xNode , std::vector< css::uno::Reference< css::lang::XComponent > >& seqComponents ); /*-**************************************************************************************************** @@ -150,7 +150,7 @@ class OComponentAccess final : public ::cppu::WeakImplHelper< css::container::XE @onerror A null reference is returned. *//*-*****************************************************************************************************/ - css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ) const; + static css::uno::Reference< css::lang::XComponent > impl_getFrameComponent( const css::uno::Reference< css::frame::XFrame >& xFrame ); css::uno::WeakReference< css::frame::XDesktop > m_xOwner; /// weak reference to the desktop object! diff --git a/framework/inc/helper/ocomponentenumeration.hxx b/framework/inc/helper/ocomponentenumeration.hxx index af48cdfe042f..5791b38779e3 100644 --- a/framework/inc/helper/ocomponentenumeration.hxx +++ b/framework/inc/helper/ocomponentenumeration.hxx @@ -126,7 +126,7 @@ class OComponentEnumeration final : public ::cppu::WeakImplHelper< css::containe @descr There are two ways to delete an instance of this class.<BR> 1) delete with destructor<BR> 2) dispose from parent or factory or...<BR> - This method do the same for both ways! It frees used memory and release references... + This method does the same for both ways! It frees used memory and releases references... @seealso method dispose() @seealso destructor ~TaskEnumeration() diff --git a/framework/inc/helper/oframes.hxx b/framework/inc/helper/oframes.hxx index d29063407aa4..d626f07d1a52 100644 --- a/framework/inc/helper/oframes.hxx +++ b/framework/inc/helper/oframes.hxx @@ -175,7 +175,7 @@ class OFrames final : public ::cppu::WeakImplHelper< css::frame::XFrames > @param "seqSource" , reference to sequence for append. @return "seqDestination" is parameter AND return value at the same time. */ - void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination , + static void impl_appendSequence( css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqDestination , const css::uno::Sequence< css::uno::Reference< css::frame::XFrame > >& seqSource ); static bool impldbg_checkParameter_queryFrames ( sal_Int32 nSearchFlags ); diff --git a/framework/inc/helper/persistentwindowstate.hxx b/framework/inc/helper/persistentwindowstate.hxx index 2dd9391576df..8d062488fe83 100644 --- a/framework/inc/helper/persistentwindowstate.hxx +++ b/framework/inc/helper/persistentwindowstate.hxx @@ -39,7 +39,7 @@ namespace framework{ any external process e.g. the office bean) we save and restore the window state of it corresponding to the document service factory. That means: one instance of this class will be a listener on one frame which container window was created by ourself. - We listen for frame action events and every time a component will deattached from a frame + We listen for frame action events and every time a component will detached from a frame we store its current position and size to the configuration. Every time a new component is attached to a frame first time(!) we restore this information again. @@ -72,7 +72,7 @@ class PersistentWindowState final : public ::cppu::WeakImplHelper< public: // ctor/dtor - PersistentWindowState(const css::uno::Reference< css::uno::XComponentContext >& xContext); + PersistentWindowState(css::uno::Reference< css::uno::XComponentContext > xContext); virtual ~PersistentWindowState( ) override; // XInitialization diff --git a/framework/inc/helper/propertysetcontainer.hxx b/framework/inc/helper/propertysetcontainer.hxx index 75c8414c3698..849899784c64 100644 --- a/framework/inc/helper/propertysetcontainer.hxx +++ b/framework/inc/helper/propertysetcontainer.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> +#include <mutex> #include <vector> #include <cppuhelper/weak.hxx> #include <com/sun/star/container/XIndexContainer.hpp> @@ -65,7 +66,7 @@ class PropertySetContainer : public css::container::XIndexContainer , private: typedef std::vector< css::uno::Reference< css::beans::XPropertySet > > PropertySetVector; PropertySetVector m_aPropertySetVector; - + std::mutex m_aMutex; }; } diff --git a/framework/inc/helper/statusindicatorfactory.hxx b/framework/inc/helper/statusindicatorfactory.hxx index b3f3984f7a2c..c492a645f5bc 100644 --- a/framework/inc/helper/statusindicatorfactory.hxx +++ b/framework/inc/helper/statusindicatorfactory.hxx @@ -170,7 +170,7 @@ class StatusIndicatorFactory final : public ::cppu::WeakImplHelper< // interface public: - StatusIndicatorFactory(const css::uno::Reference< css::uno::XComponentContext >& xContext); + StatusIndicatorFactory(css::uno::Reference< css::uno::XComponentContext > xContext); virtual OUString SAL_CALL getImplementationName() override { diff --git a/framework/inc/helper/tagwindowasmodified.hxx b/framework/inc/helper/tagwindowasmodified.hxx index 1528c63c5b18..e8c9fff22da9 100644 --- a/framework/inc/helper/tagwindowasmodified.hxx +++ b/framework/inc/helper/tagwindowasmodified.hxx @@ -26,7 +26,6 @@ #include <com/sun/star/util/XModifiable.hpp> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/weakref.hxx> #include <vcl/window.hxx> namespace framework{ diff --git a/framework/inc/helper/titlebarupdate.hxx b/framework/inc/helper/titlebarupdate.hxx index dccfd91dbd62..cad8d91f042c 100644 --- a/framework/inc/helper/titlebarupdate.hxx +++ b/framework/inc/helper/titlebarupdate.hxx @@ -68,7 +68,7 @@ class TitleBarUpdate final : public ::cppu::WeakImplHelper< public: // ctor/dtor - TitleBarUpdate(const css::uno::Reference< css::uno::XComponentContext >& xContext); + TitleBarUpdate(css::uno::Reference< css::uno::XComponentContext > xContext); virtual ~TitleBarUpdate( ) override; // XInterface, XTypeProvider @@ -129,7 +129,7 @@ class TitleBarUpdate final : public ::cppu::WeakImplHelper< the frame which contains the component and where the title must be set on the window title bar. */ - void impl_updateTitle(const css::uno::Reference< css::frame::XFrame >& xFrame); + static void impl_updateTitle(const css::uno::Reference< css::frame::XFrame >& xFrame); //Hook to set GNOME3/Windows 7 applicationID for toplevel frames //http://msdn.microsoft.com/en-us/library/dd378459(v=VS.85).aspx diff --git a/framework/inc/helper/vclstatusindicator.hxx b/framework/inc/helper/vclstatusindicator.hxx index bd325665f8d7..6afae95650f1 100644 --- a/framework/inc/helper/vclstatusindicator.hxx +++ b/framework/inc/helper/vclstatusindicator.hxx @@ -59,7 +59,7 @@ class VCLStatusIndicator final : public ::cppu::WeakImplHelper< css::task::XSta public: /// ctor - VCLStatusIndicator(const css::uno::Reference< css::awt::XWindow >& xParentWindow); + VCLStatusIndicator(css::uno::Reference< css::awt::XWindow > xParentWindow); /// dtor virtual ~VCLStatusIndicator() override; diff --git a/framework/inc/helper/wakeupthread.hxx b/framework/inc/helper/wakeupthread.hxx index f9099180d03f..cdc8700a5266 100644 --- a/framework/inc/helper/wakeupthread.hxx +++ b/framework/inc/helper/wakeupthread.hxx @@ -23,8 +23,8 @@ #include <com/sun/star/uno/Reference.hxx> #include <cppuhelper/weakref.hxx> -#include <osl/conditn.hxx> -#include <osl/mutex.hxx> +#include <condition_variable> +#include <mutex> #include <salhelper/thread.hxx> namespace com::sun::star::util @@ -37,9 +37,8 @@ namespace framework class WakeUpThread final : public salhelper::Thread { css::uno::WeakReference<css::util::XUpdatable> updatable_; - osl::Condition condition_; - - osl::Mutex mutex_; + std::condition_variable condition_; + std::mutex mutex_; bool terminate_; void execute() override; diff --git a/framework/inc/jobs/configaccess.hxx b/framework/inc/jobs/configaccess.hxx index 4d73df2e1c46..2efc22cb8e87 100644 --- a/framework/inc/jobs/configaccess.hxx +++ b/framework/inc/jobs/configaccess.hxx @@ -20,8 +20,8 @@ #pragma once #include <com/sun/star/uno/XComponentContext.hpp> - #include <rtl/ustring.hxx> +#include <mutex> namespace framework{ @@ -50,7 +50,7 @@ class ConfigAccess final // member private: - mutable osl::Mutex m_mutex; + mutable std::mutex m_mutex; /** reference to the uno service manager @@ -69,10 +69,11 @@ class ConfigAccess final // native interface methods + void closeImpl(); public: - ConfigAccess( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const OUString& sRoot ); + ConfigAccess( css::uno::Reference< css::uno::XComponentContext > xContext, + OUString sRoot ); ~ConfigAccess(); void open ( EOpenMode eMode ); diff --git a/framework/inc/jobs/helponstartup.hxx b/framework/inc/jobs/helponstartup.hxx index 63326f00454d..aaaf35492ffe 100644 --- a/framework/inc/jobs/helponstartup.hxx +++ b/framework/inc/jobs/helponstartup.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> +#include <mutex> #include <string_view> #include <cppuhelper/implbase.hxx> @@ -44,7 +45,7 @@ class HelpOnStartup final : public ::cppu::WeakImplHelper< css::lang::XServiceIn // member private: - osl::Mutex m_mutex; + std::mutex m_mutex; /** @short reference to a uno service manager. */ css::uno::Reference< css::uno::XComponentContext > m_xContext; @@ -77,7 +78,7 @@ class HelpOnStartup final : public ::cppu::WeakImplHelper< css::lang::XServiceIn reference to the uno service manager, which created this instance. Can be used later to create own needed uno resources on demand. */ - HelpOnStartup(const css::uno::Reference< css::uno::XComponentContext >& xContext); + HelpOnStartup(css::uno::Reference< css::uno::XComponentContext > xContext); /** @short does nothing real ... diff --git a/framework/inc/jobs/job.hxx b/framework/inc/jobs/job.hxx index 185b201d9a31..8afc1966f657 100644 --- a/framework/inc/jobs/job.hxx +++ b/framework/inc/jobs/job.hxx @@ -158,9 +158,9 @@ class Job final : public ::cppu::WeakImplHelper< public: Job( const css::uno::Reference< css::uno::XComponentContext >& xContext , - const css::uno::Reference< css::frame::XFrame >& xFrame ); + css::uno::Reference< css::frame::XFrame > xFrame ); Job( const css::uno::Reference< css::uno::XComponentContext >& xContext , - const css::uno::Reference< css::frame::XModel >& xModel ); + css::uno::Reference< css::frame::XModel > xModel ); virtual ~Job( ) override; void setDispatchResultFake( const css::uno::Reference< css::frame::XDispatchResultListener >& xListener , diff --git a/framework/inc/jobs/jobconst.hxx b/framework/inc/jobs/jobconst.hxx index 7c6fc17cc715..569c2d4c93f6 100644 --- a/framework/inc/jobs/jobconst.hxx +++ b/framework/inc/jobs/jobconst.hxx @@ -34,9 +34,9 @@ namespace framework class JobConst { public: - static constexpr OUStringLiteral ANSWER_DEACTIVATE_JOB = u"Deactivate"; - static constexpr OUStringLiteral ANSWER_SAVE_ARGUMENTS = u"SaveArguments"; - static constexpr OUStringLiteral ANSWER_SEND_DISPATCHRESULT = u"SendDispatchResult"; + static constexpr OUString ANSWER_DEACTIVATE_JOB = u"Deactivate"_ustr; + static constexpr OUString ANSWER_SAVE_ARGUMENTS = u"SaveArguments"_ustr; + static constexpr OUString ANSWER_SEND_DISPATCHRESULT = u"SendDispatchResult"_ustr; }; } // namespace framework diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx index 48004d279ab8..050bce6a84a9 100644 --- a/framework/inc/jobs/jobdata.hxx +++ b/framework/inc/jobs/jobdata.hxx @@ -25,6 +25,7 @@ #include <rtl/ustring.hxx> #include <string_view> +#include <utility> #include <vector> namespace framework{ @@ -86,10 +87,10 @@ class JobData final OUString m_sJobName; OUString m_sDocEvent; - TJob2DocEventBinding(const OUString& sJobName , - const OUString& sDocEvent) - : m_sJobName (sJobName ) - , m_sDocEvent(sDocEvent) + TJob2DocEventBinding(OUString sJobName , + OUString sDocEvent) + : m_sJobName (std::move(sJobName )) + , m_sDocEvent(std::move(sDocEvent)) {} }; @@ -164,7 +165,7 @@ class JobData final public: - JobData( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + JobData( css::uno::Reference< css::uno::XComponentContext > xContext ); JobData( const JobData& rCopy ); ~JobData( ); @@ -179,7 +180,7 @@ class JobData final std::vector< css::beans::NamedValue > getJobConfig () const; bool hasConfig () const; - bool hasCorrectContext ( const OUString& rModuleIdent ) const; + bool hasCorrectContext ( std::u16string_view rModuleIdent ) const; void setEnvironment ( EEnvironment eEnvironment ); void setAlias ( const OUString& sAlias ); diff --git a/framework/inc/jobs/joburl.hxx b/framework/inc/jobs/joburl.hxx index 3a227a375c78..23486ec2f4d9 100644 --- a/framework/inc/jobs/joburl.hxx +++ b/framework/inc/jobs/joburl.hxx @@ -96,7 +96,7 @@ class JobURL private: - static bool implst_split( const OUString& sPart , + static bool implst_split( std::u16string_view sPart , const char* pPartIdentifier , sal_Int32 nPartLength , OUString& rPartValue , diff --git a/framework/inc/jobs/shelljob.hxx b/framework/inc/jobs/shelljob.hxx index d03ee7921dc0..736c0630fb7b 100644 --- a/framework/inc/jobs/shelljob.hxx +++ b/framework/inc/jobs/shelljob.hxx @@ -54,7 +54,7 @@ class ShellJob final : public ::cppu::WeakImplHelper< css::lang::XServiceInfo,cs reference to the uno service manager, which created this instance. Can be used later to create own needed uno resources on demand. */ - ShellJob(const css::uno::Reference< css::uno::XComponentContext >& xContext); + ShellJob(css::uno::Reference< css::uno::XComponentContext > xContext); /** @short does nothing real ... @@ -115,7 +115,7 @@ class ShellJob final : public ::cppu::WeakImplHelper< css::lang::XServiceInfo,cs @return sal_True if command was executed successfully; sal_False otherwise. */ - bool impl_execute(const OUString& sCommand , + static bool impl_execute(const OUString& sCommand , const css::uno::Sequence< OUString >& lArguments , bool bCheckExitCode); }; diff --git a/framework/inc/menuconfiguration.hxx b/framework/inc/menuconfiguration.hxx index a076de21b504..9389ed3e3986 100644 --- a/framework/inc/menuconfiguration.hxx +++ b/framework/inc/menuconfiguration.hxx @@ -20,6 +20,7 @@ #pragma once #include <cppuhelper/weakref.hxx> +#include <utility> namespace com::sun::star::container { class XIndexAccess; } namespace com::sun::star::frame { class XDispatchProvider; } @@ -35,16 +36,16 @@ struct MenuAttributes private: oslInterlockedCount refCount; - MenuAttributes(const OUString& rFrame, const OUString& rImageIdStr) + MenuAttributes(OUString sFrame, OUString sImageIdStr) : refCount(0) - , aTargetFrame(rFrame) - , aImageId(rImageIdStr) + , aTargetFrame(std::move(sFrame)) + , aImageId(std::move(sImageIdStr)) { } - MenuAttributes(const css::uno::WeakReference<css::frame::XDispatchProvider>& rDispatchProvider) + MenuAttributes(css::uno::WeakReference<css::frame::XDispatchProvider> _xDispatchProvider) : refCount(0) - , xDispatchProvider(rDispatchProvider) + , xDispatchProvider(std::move(_xDispatchProvider)) { } @@ -76,7 +77,7 @@ class MenuConfiguration final public: MenuConfiguration( // use const when giving a UNO reference by reference - const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + css::uno::Reference< css::uno::XComponentContext > rxContext ); ~MenuConfiguration(); diff --git a/framework/inc/pch/precompiled_fwk.hxx b/framework/inc/pch/precompiled_fwk.hxx index 4b14a600b18a..286a89247753 100644 --- a/framework/inc/pch/precompiled_fwk.hxx +++ b/framework/inc/pch/precompiled_fwk.hxx @@ -13,7 +13,7 @@ manual changes will be rewritten by the next run of update_pch.sh (which presumably also fixes all possible problems, so it's usually better to use it). - Generated on 2021-09-28 05:36:23 using: + Generated on 2023-07-19 09:22:12 using: ./bin/update_pch framework fwk --cutoff=7 --exclude:system --include:module --include:local If after updating build fails, use the following command to locate conflicting headers: @@ -29,19 +29,23 @@ #include <cmath> #include <cstddef> #include <cstdlib> +#include <cstring> #include <float.h> #include <functional> #include <initializer_list> #include <iomanip> #include <limits.h> #include <limits> +#include <list> #include <map> #include <math.h> #include <memory> +#include <mutex> #include <new> #include <numeric> #include <optional> #include <ostream> +#include <span> #include <stddef.h> #include <string.h> #include <string> @@ -50,9 +54,9 @@ #include <unordered_map> #include <utility> #include <vector> +#include <boost/property_tree/ptree_fwd.hpp> #endif // PCH_LEVEL >= 1 #if PCH_LEVEL >= 2 -#include <osl/conditn.h> #include <osl/conditn.hxx> #include <osl/diagnose.h> #include <osl/endian.h> @@ -69,6 +73,7 @@ #include <rtl/locale.h> #include <rtl/math.h> #include <rtl/ref.hxx> +#include <rtl/strbuf.h> #include <rtl/strbuf.hxx> #include <rtl/string.h> #include <rtl/string.hxx> @@ -79,6 +84,7 @@ #include <rtl/ustrbuf.hxx> #include <rtl/ustring.h> #include <rtl/ustring.hxx> +#include <rtl/uuid.h> #include <sal/detail/log.h> #include <sal/log.hxx> #include <sal/macros.h> @@ -86,37 +92,23 @@ #include <sal/types.h> #include <sal/typesizes.h> #include <vcl/Scanline.hxx> +#include <vcl/WindowPosSize.hxx> #include <vcl/alpha.hxx> #include <vcl/bitmap.hxx> #include <vcl/bitmap/BitmapTypes.hxx> #include <vcl/bitmapex.hxx> -#include <vcl/cairo.hxx> #include <vcl/checksum.hxx> #include <vcl/commandinfoprovider.hxx> -#include <vcl/devicecoordinate.hxx> #include <vcl/dllapi.h> #include <vcl/fntstyle.hxx> #include <vcl/font.hxx> #include <vcl/gradient.hxx> +#include <vcl/graph.hxx> +#include <vcl/keycod.hxx> +#include <vcl/keycodes.hxx> #include <vcl/mapmod.hxx> -#include <vcl/menu.hxx> -#include <vcl/metaactiontypes.hxx> #include <vcl/region.hxx> -#include <vcl/rendercontext/AddFontSubstituteFlags.hxx> -#include <vcl/rendercontext/AntialiasingFlags.hxx> -#include <vcl/rendercontext/DrawGridFlags.hxx> -#include <vcl/rendercontext/DrawImageFlags.hxx> -#include <vcl/rendercontext/DrawModeFlags.hxx> -#include <vcl/rendercontext/DrawTextFlags.hxx> -#include <vcl/rendercontext/GetDefaultFontFlags.hxx> -#include <vcl/rendercontext/ImplMapRes.hxx> -#include <vcl/rendercontext/InvertFlags.hxx> #include <vcl/rendercontext/RasterOp.hxx> -#include <vcl/rendercontext/SalLayoutFlags.hxx> -#include <vcl/rendercontext/State.hxx> -#include <vcl/rendercontext/SystemTextColorFlags.hxx> -#include <vcl/salnativewidgets.hxx> -#include <vcl/scopedbitmapaccess.hxx> #include <vcl/settings.hxx> #include <vcl/svapp.hxx> #include <vcl/task.hxx> @@ -125,19 +117,23 @@ #include <vcl/vclenum.hxx> #include <vcl/vclptr.hxx> #include <vcl/vclreferencebase.hxx> -#include <vcl/wall.hxx> #include <vcl/window.hxx> +#include <vcl/windowstate.hxx> #endif // PCH_LEVEL >= 2 #if PCH_LEVEL >= 3 #include <basegfx/basegfxdllapi.h> #include <basegfx/color/bcolor.hxx> +#include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/hommatrixtemplate.hxx> #include <basegfx/numeric/ftools.hxx> #include <basegfx/point/b2dpoint.hxx> #include <basegfx/point/b2ipoint.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> +#include <basegfx/range/Range2D.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/range/basicrange.hxx> +#include <basegfx/tuple/Size2D.hxx> #include <basegfx/tuple/Tuple2D.hxx> #include <basegfx/tuple/Tuple3D.hxx> #include <basegfx/tuple/b2dtuple.hxx> @@ -145,11 +141,13 @@ #include <basegfx/tuple/b2ituple.hxx> #include <basegfx/tuple/b3dtuple.hxx> #include <basegfx/utils/common.hxx> +#include <basegfx/vector/b2dsize.hxx> #include <basegfx/vector/b2dvector.hxx> #include <basegfx/vector/b2enums.hxx> +#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2ivector.hxx> #include <classes/fwkresid.hxx> -#include <com/sun/star/awt/DeviceInfo.hpp> +#include <com/sun/star/awt/GradientStyle.hpp> #include <com/sun/star/awt/Key.hpp> #include <com/sun/star/awt/KeyEvent.hpp> #include <com/sun/star/awt/KeyGroup.hpp> @@ -165,7 +163,6 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XIndexContainer.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/drawing/LineCap.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/frame/ControlCommand.hpp> #include <com/sun/star/frame/Desktop.hpp> @@ -182,6 +179,8 @@ #include <com/sun/star/frame/XStatusListener.hpp> #include <com/sun/star/frame/XUIControllerFactory.hpp> #include <com/sun/star/io/IOException.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/EventObject.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -190,6 +189,8 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/task/XInteractionRequest.hpp> #include <com/sun/star/ui/ItemStyle.hpp> #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/ui/XUIConfigurationListener.hpp> @@ -199,7 +200,6 @@ #include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp> #include <com/sun/star/uno/Any.h> #include <com/sun/star/uno/Any.hxx> -#include <com/sun/star/uno/Exception.hpp> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/RuntimeException.hpp> @@ -208,6 +208,7 @@ #include <com/sun/star/uno/Type.h> #include <com/sun/star/uno/Type.hxx> #include <com/sun/star/uno/TypeClass.hdl> +#include <com/sun/star/uno/XAggregation.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/uno/XInterface.hpp> #include <com/sun/star/uno/XWeak.hpp> @@ -220,19 +221,21 @@ #include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/xml/sax/SAXException.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <comphelper/compbase.hxx> #include <comphelper/comphelperdllapi.h> +#include <comphelper/diagnose_ex.hxx> +#include <comphelper/errcode.hxx> #include <comphelper/interfacecontainer2.hxx> #include <comphelper/lok.hxx> #include <comphelper/multicontainer2.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/propertysequence.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <comphelper/sequenceashashmap.hxx> -#include <comphelper/servicehelper.hxx> #include <cppu/cppudllapi.h> #include <cppu/unotype.hxx> #include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> #include <cppuhelper/cppuhelperdllapi.h> #include <cppuhelper/implbase.hxx> #include <cppuhelper/interfacecontainer.h> @@ -247,6 +250,7 @@ #include <i18nlangtag/languagetag.hxx> #include <o3tl/cow_wrapper.hxx> #include <o3tl/safeint.hxx> +#include <o3tl/string_view.hxx> #include <o3tl/strong_int.hxx> #include <o3tl/typed_flags_set.hxx> #include <o3tl/underlyingenumvalue.hxx> @@ -263,15 +267,16 @@ #include <tools/color.hxx> #include <tools/date.hxx> #include <tools/degree.hxx> -#include <tools/diagnose_ex.h> #include <tools/fontenum.hxx> #include <tools/gen.hxx> +#include <tools/lineend.hxx> #include <tools/link.hxx> #include <tools/long.hxx> #include <tools/mapunit.hxx> #include <tools/poly.hxx> #include <tools/ref.hxx> #include <tools/solar.h> +#include <tools/stream.hxx> #include <tools/toolsdllapi.h> #include <tools/urlobj.hxx> #include <typelib/typeclass.h> @@ -282,8 +287,6 @@ #include <uno/data.h> #include <uno/sequence2.h> #include <unotools/configmgr.hxx> -#include <unotools/fontdefs.hxx> -#include <unotools/mediadescriptor.hxx> #include <unotools/options.hxx> #include <unotools/unotoolsdllapi.h> #endif // PCH_LEVEL >= 3 diff --git a/framework/inc/properties.h b/framework/inc/properties.h index 06da65ca733c..c4eef829af0f 100644 --- a/framework/inc/properties.h +++ b/framework/inc/properties.h @@ -25,16 +25,15 @@ namespace framework{ /** properties for "Frame" class */ -#define FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER "DispatchRecorderSupplier" -#define FRAME_PROPNAME_ASCII_ISHIDDEN "IsHidden" -#define FRAME_PROPNAME_ASCII_LAYOUTMANAGER "LayoutManager" -#define FRAME_PROPNAME_ASCII_TITLE "Title" -#define FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION "IndicatorInterception" -#define FRAME_PROPNAME_ASCII_URL "URL" +inline constexpr OUString FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER = u"DispatchRecorderSupplier"_ustr; +inline constexpr OUString FRAME_PROPNAME_ASCII_ISHIDDEN = u"IsHidden"_ustr; +inline constexpr OUString FRAME_PROPNAME_ASCII_LAYOUTMANAGER = u"LayoutManager"_ustr; +inline constexpr OUString FRAME_PROPNAME_ASCII_TITLE = u"Title"_ustr; +inline constexpr OUString FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION = u"IndicatorInterception"_ustr; +inline constexpr OUString FRAME_PROPNAME_ASCII_URL = u"URL"_ustr; // Please add new entries alphabetical sorted and correct all other handles! // Start counting with 0, so it can be used as direct index into an array too. -// Don't forget updating of define FRAME_PROPCOUNT below!!! #define FRAME_PROPHANDLE_DISPATCHRECORDERSUPPLIER 0 #define FRAME_PROPHANDLE_ISHIDDEN 1 #define FRAME_PROPHANDLE_LAYOUTMANAGER 2 @@ -42,44 +41,15 @@ namespace framework{ #define FRAME_PROPHANDLE_INDICATORINTERCEPTION 4 #define FRAME_PROPHANDLE_URL 5 -#define FRAME_PROPCOUNT 6 - -/** properties for "PathSettings" class */ - -#define PATHSETTINGS_PROPNAME_ASCII_ADDIN "Addin" -#define PATHSETTINGS_PROPNAME_ASCII_AUTOCORRECT "AutoCorrect" -#define PATHSETTINGS_PROPNAME_ASCII_AUTOTEXT "AutoText" -#define PATHSETTINGS_PROPNAME_ASCII_BACKUP "Backup" -#define PATHSETTINGS_PROPNAME_ASCII_BASIC "Basic" -#define PATHSETTINGS_PROPNAME_ASCII_BITMAP "Bitmap" -#define PATHSETTINGS_PROPNAME_ASCII_CONFIG "Config" -#define PATHSETTINGS_PROPNAME_ASCII_DICTIONARY "Dictionary" -#define PATHSETTINGS_PROPNAME_ASCII_FAVORITE "Favorite" -#define PATHSETTINGS_PROPNAME_ASCII_FILTER "Filter" -#define PATHSETTINGS_PROPNAME_ASCII_GALLERY "Gallery" -#define PATHSETTINGS_PROPNAME_ASCII_GRAPHIC "Graphic" -#define PATHSETTINGS_PROPNAME_ASCII_HELP "Help" -#define PATHSETTINGS_PROPNAME_ASCII_LINGUISTIC "Linguistic" -#define PATHSETTINGS_PROPNAME_ASCII_MODULE "Module" -#define PATHSETTINGS_PROPNAME_ASCII_PALETTE "Palette" -#define PATHSETTINGS_PROPNAME_ASCII_PLUGIN "Plugin" -#define PATHSETTINGS_PROPNAME_ASCII_STORAGE "Storage" -#define PATHSETTINGS_PROPNAME_ASCII_TEMP "Temp" -#define PATHSETTINGS_PROPNAME_ASCII_TEMPLATE "Template" -#define PATHSETTINGS_PROPNAME_ASCII_UICONFIG "UIConfig" -#define PATHSETTINGS_PROPNAME_ASCII_USERCONFIG "UserConfig" -#define PATHSETTINGS_PROPNAME_ASCII_USERDICTIONARY "UserDictionary" -#define PATHSETTINGS_PROPNAME_ASCII_WORK "Work" - - /** properties for "LayoutManager" class */ -#define LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER "MenuBarCloser" -#define LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS "AutomaticToolbars" -#define LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY "RefreshContextToolbarVisibility" -#define LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI "HideCurrentUI" -#define LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT "LockCount" -#define LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE "PreserveContentSize" +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER = u"MenuBarCloser"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS = u"AutomaticToolbars"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY = u"RefreshContextToolbarVisibility"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI = u"HideCurrentUI"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT = u"LockCount"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE = u"PreserveContentSize"_ustr; +inline constexpr OUString LAYOUTMANAGER_PROPNAME_ASCII_REFRESHTOOLTIP = u"RefreshContextToolbarToolTip"_ustr; #define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER @@ -89,20 +59,21 @@ namespace framework{ #define LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI 3 #define LAYOUTMANAGER_PROPHANDLE_LOCKCOUNT 4 #define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5 +#define LAYOUTMANAGER_PROPHANDLE_REFRESHTOOLTIP 6 /** properties for "UICommandDescription" class */ -#define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST "private:resource/image/commandimagelist" -#define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST "private:resource/image/commandrotateimagelist" -#define UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST "private:resource/image/commandmirrorimagelist" +inline constexpr OUString UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST = u"private:resource/image/commandimagelist"_ustr; +inline constexpr OUString UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST = u"private:resource/image/commandrotateimagelist"_ustr; +inline constexpr OUString UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST = u"private:resource/image/commandmirrorimagelist"_ustr; #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 /** properties for "AutoRecovery" class */ -#define AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA "ExistsRecoveryData" -#define AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA "ExistsSessionData" -#define AUTORECOVERY_PROPNAME_ASCII_CRASHED "Crashed" +inline constexpr OUString AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA = u"ExistsRecoveryData"_ustr; +inline constexpr OUString AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA = u"ExistsSessionData"_ustr; +inline constexpr OUString AUTORECOVERY_PROPNAME_ASCII_CRASHED = u"Crashed"_ustr; #define AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA #define AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA @@ -112,28 +83,14 @@ namespace framework{ #define AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA 1 #define AUTORECOVERY_PROPHANDLE_CRASHED 2 -#define AUTORECOVERY_PROPCOUNT 3 - /** properties for Filter config */ -#define FILTER_PROPNAME_ASCII_DOCUMENTSERVICE "DocumentService" +inline constexpr OUString FILTER_PROPNAME_ASCII_DOCUMENTSERVICE = u"DocumentService"_ustr; /** properties for office module config (Setup.xcu) */ -#define OFFICEFACTORY_PROPNAME_ASCII_UINAME "ooSetupFactoryUIName" -#define OFFICEFACTORY_PROPNAME_ASCII_ICON "ooSetupFactoryIcon" - -/** properties for tab window (old) */ -#define TABWINDOW_PROPNAME_ASCII_PARENTWINDOW "ParentWindow" -#define TABWINDOW_PROPNAME_ASCII_TOPWINDOW "TopWindow" -#define TABWINDOW_PROPNAME_PARENTWINDOW TABWINDOW_PROPNAME_ASCII_PARENTWINDOW -#define TABWINDOW_PROPNAME_TOPWINDOW TABWINDOW_PROPNAME_ASCII_TOPWINDOW - -#define TABWINDOW_PROPHANDLE_PARENTWINDOW 0 -#define TABWINDOW_PROPHANDLE_TOPWINDOW 1 -#define TABWINDOW_PROPCOUNT 2 - -#define TABWINDOWSERVICE_PROPHANDLE_WINDOW 0 +inline constexpr OUString OFFICEFACTORY_PROPNAME_ASCII_UINAME = u"ooSetupFactoryUIName"_ustr; +inline constexpr OUString OFFICEFACTORY_PROPNAME_ASCII_ICON = u"ooSetupFactoryIcon"_ustr; /** provides some helper methods to implement property sets. */ diff --git a/framework/inc/protocols.h b/framework/inc/protocols.h index 30d87cc59336..bbadb7e71888 100644 --- a/framework/inc/protocols.h +++ b/framework/inc/protocols.h @@ -26,7 +26,6 @@ #include <string_view> #include <o3tl/string_view.hxx> -#include <rtl/ustring.hxx> namespace framework{ diff --git a/framework/inc/services.h b/framework/inc/services.h index 885ade4fbf47..c87008f8eb7b 100644 --- a/framework/inc/services.h +++ b/framework/inc/services.h @@ -19,21 +19,23 @@ #pragma once +#include <rtl/ustring.hxx> + namespace framework{ // used servicenames by framework -#define SERVICENAME_FILTERFACTORY "com.sun.star.document.FilterFactory" -#define SERVICENAME_CFGUPDATEACCESS "com.sun.star.configuration.ConfigurationUpdateAccess" // provides read/write access to the configuration -#define SERVICENAME_CFGREADACCESS "com.sun.star.configuration.ConfigurationAccess" // provides readonly access to the configuration -#define SERVICENAME_JOB "com.sun.star.task.Job" -#define SERVICENAME_PROTOCOLHANDLER "com.sun.star.frame.ProtocolHandler" -#define SERVICENAME_POPUPMENUCONTROLLER "com.sun.star.frame.PopupMenuController" +inline constexpr OUString SERVICENAME_FILTERFACTORY = u"com.sun.star.document.FilterFactory"_ustr; +inline constexpr OUString SERVICENAME_CFGUPDATEACCESS = u"com.sun.star.configuration.ConfigurationUpdateAccess"_ustr; // provides read/write access to the configuration +inline constexpr OUString SERVICENAME_CFGREADACCESS = u"com.sun.star.configuration.ConfigurationAccess"_ustr; // provides readonly access to the configuration +inline constexpr OUString SERVICENAME_JOB = u"com.sun.star.task.Job"_ustr; +inline constexpr OUString SERVICENAME_PROTOCOLHANDLER = u"com.sun.star.frame.ProtocolHandler"_ustr; +inline constexpr OUString SERVICENAME_POPUPMENUCONTROLLER = u"com.sun.star.frame.PopupMenuController"_ustr; // used implementationnames by framework #define IMPLEMENTATIONNAME_QUICKLAUNCHER "com.sun.star.comp.desktop.QuickstartWrapper" -#define IMPLEMENTATIONNAME_FWK_TASKCREATOR "com.sun.star.comp.framework.TaskCreator" +inline constexpr OUString IMPLEMENTATIONNAME_FWK_TASKCREATOR = u"com.sun.star.comp.framework.TaskCreator"_ustr; } // namespace framework diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 189be410bfc9..f2f32a53a12f 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -42,9 +42,11 @@ #include <vcl/timer.hxx> class MenuBar; + namespace framework { - + class MenuBarWrapper; + class ProgressBarWrapper; class ToolbarLayoutManager; class GlobalSettings; namespace detail @@ -175,7 +177,7 @@ namespace framework // query - css::uno::Reference< css::ui::XUIElement > implts_findElement( const OUString& aName ); + css::uno::Reference< css::ui::XUIElement > implts_findElement( std::u16string_view aName ); bool implts_readWindowStateData( const OUString& rName, UIElement& rElementData ); void implts_writeWindowStateData( const OUString& rName, const UIElement& rElementData ); @@ -250,10 +252,10 @@ namespace framework css::awt::Rectangle m_aDockingArea; css::uno::Reference< css::ui::XDockingAreaAcceptor > m_xDockingAreaAcceptor; rtl::Reference< MenuBarManager > m_xInplaceMenuBar; - css::uno::Reference< css::ui::XUIElement > m_xMenuBar; + rtl::Reference< MenuBarWrapper > m_xMenuBar; UIElement m_aStatusBarElement; UIElement m_aProgressBarElement; - css::uno::Reference< css::ui::XUIElement > m_xProgressBarBackup; + rtl::Reference< ProgressBarWrapper > m_xProgressBarBackup; css::uno::Reference< css::frame::XModuleManager2 > m_xModuleManager; css::uno::Reference< css::ui::XUIElementFactoryManager > m_xUIElementFactoryManager; css::uno::Reference< css::container::XNameAccess > m_xPersistentWindowState; diff --git a/framework/inc/stdtypes.h b/framework/inc/stdtypes.h index feec3ef92ceb..265daba7786e 100644 --- a/framework/inc/stdtypes.h +++ b/framework/inc/stdtypes.h @@ -21,9 +21,6 @@ #include <com/sun/star/awt/KeyEvent.hpp> -#include <comphelper/multiinterfacecontainer2.hxx> -#include <rtl/ustring.hxx> - namespace framework{ /** @@ -55,14 +52,6 @@ struct KeyEventEqualsFunc } }; -/** - It can be used to map names (e.g. of properties) to her corresponding handles. - Our helper class OPropertySetHelper works optimized with handles but sometimes we have only a property name. - Mapping between these two parts of a property should be done in the fastest way :-) -*/ - -typedef comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> ListenerHash; - } // namespace framework /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc index 18b372915b9b..086fe14a4e82 100644 --- a/framework/inc/strings.hrc +++ b/framework/inc/strings.hrc @@ -19,7 +19,7 @@ #pragma once -#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String)) +#define NC_(Context, String) TranslateId(Context, u8##String) #define STR_MENU_HEADFOOTALL NC_("STR_MENU_HEADFOOTALL", "All" ) #define STR_UPDATEDOC NC_("STR_UPDATEDOC", "~Update" ) @@ -36,6 +36,7 @@ #define STR_CLEAR_RECENT_FILES NC_("STR_CLEAR_RECENT_FILES", "Clear List") #define STR_CLEAR_RECENT_FILES_HELP NC_("STR_CLEAR_RECENT_FILES_HELP", "Clears the list with the most recently opened files. This action can not be undone.") #define STR_REMOTE_TITLE NC_("STR_REMOTE_TITLE", " (Remote)") +#define STR_EMDASH_SEPARATOR NC_("STR_EMDASH_SEPARATOR", " — ") #define STR_SAFEMODE_TITLE NC_("STR_SAFEMODE_TITLE", " (Safe Mode)") #define STR_TOOLBAR_TITLE_ADDON NC_("STR_TOOLBAR_TITLE_ADDON", "Add-On %num%") #define STR_FULL_DISC_RETRY_BUTTON NC_("STR_FULL_DISC_RETRY_BUTTON", "Retry" ) diff --git a/framework/inc/targets.h b/framework/inc/targets.h index 7112e9210644..331eff0dcee7 100644 --- a/framework/inc/targets.h +++ b/framework/inc/targets.h @@ -19,17 +19,19 @@ #pragma once +#include <rtl/ustring.hxx> + namespace framework{ // Values for special frame search ... sTargetFrameName of findFrame() or queryDispatch() or loadComponentFromURL() -#define SPECIALTARGET_SELF u"_self" // The frame himself is searched. +inline constexpr OUString SPECIALTARGET_SELF = u"_self"_ustr; // The frame himself is searched. #define SPECIALTARGET_PARENT u"_parent" // The direct parent frame is searched. -#define SPECIALTARGET_TOP u"_top" // Search at our parents for the first task (if any exist) or a frame without a parent. -#define SPECIALTARGET_BLANK u"_blank" // Create a new task. -#define SPECIALTARGET_DEFAULT u"_default" // Create a new task or recycle an existing one -#define SPECIALTARGET_BEAMER u"_beamer" // special frame in hierarchy -#define SPECIALTARGET_HELPTASK u"OFFICE_HELP_TASK" // special name for our help task +inline constexpr OUString SPECIALTARGET_TOP = u"_top"_ustr; // Search at our parents for the first task (if any exist) or a frame without a parent. +inline constexpr OUString SPECIALTARGET_BLANK = u"_blank"_ustr; // Create a new task. +inline constexpr OUString SPECIALTARGET_DEFAULT = u"_default"_ustr; // Create a new task or recycle an existing one +inline constexpr OUString SPECIALTARGET_BEAMER = u"_beamer"_ustr; // special frame in hierarchy +inline constexpr OUString SPECIALTARGET_HELPTASK = u"OFFICE_HELP_TASK"_ustr; // special name for our help task } // namespace framework diff --git a/framework/inc/taskcreatordefs.hxx b/framework/inc/taskcreatordefs.hxx index 7ca5a02813ce..e7eca6838afb 100644 --- a/framework/inc/taskcreatordefs.hxx +++ b/framework/inc/taskcreatordefs.hxx @@ -19,39 +19,45 @@ #pragma once +#include <rtl/ustring.hxx> + /// [XFrame] if it's set, it will be used as parent frame for the new created frame. -constexpr OUStringLiteral ARGUMENT_PARENTFRAME = u"ParentFrame"; // XFrame +inline constexpr OUString ARGUMENT_PARENTFRAME = u"ParentFrame"_ustr; // XFrame /** [OUString] if it's not a special name (beginning with "_" ... which are not allowed here!) it will be set as the API name of the new created frame. */ -constexpr OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // OUString +inline constexpr OUString ARGUMENT_FRAMENAME = u"FrameName"_ustr; // OUString -/// [sal_Bool] If it's set to sal_True we will make the new created frame visible. -constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // sal_Bool +/// [bool] If it's set to true we will make the new created frame visible. +inline constexpr OUString ARGUMENT_MAKEVISIBLE = u"MakeVisible"_ustr; // bool -/** [sal_Bool] If not "ContainerWindow" property is set it force creation of a +/** [bool] If not "ContainerWindow" property is set it force creation of a top level window as new container window. */ -constexpr OUStringLiteral ARGUMENT_CREATETOPWINDOW = u"CreateTopWindow"; // sal_Bool +inline constexpr OUString ARGUMENT_CREATETOPWINDOW = u"CreateTopWindow"_ustr; // bool /// [Rectangle] Place the new created frame on this place and resize the container window. -inline constexpr OUStringLiteral ARGUMENT_POSSIZE = u"PosSize"; // Rectangle +inline constexpr OUString ARGUMENT_POSSIZE = u"PosSize"_ustr; // Rectangle /// [XWindow] an outside created window, used as container window of the new created frame. -inline constexpr OUStringLiteral ARGUMENT_CONTAINERWINDOW = u"ContainerWindow"; // XWindow +inline constexpr OUString ARGUMENT_CONTAINERWINDOW = u"ContainerWindow"_ustr; // XWindow -/** [sal_Bool] enable/disable special mode, where this frame will be part of +/** [bool] enable/disable special mode, where this frame will be part of the persistent window state feature suitable for any office module window */ -constexpr OUStringLiteral ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE - = u"SupportPersistentWindowState"; // sal_Bool +inline constexpr OUString ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE + = u"SupportPersistentWindowState"_ustr; // bool -/** [sal_Bool] enable/disable special mode, where the title bar of our +/** [bool] enable/disable special mode, where the title bar of our the new created frame will be updated automatically. Default = ON ! */ -inline constexpr OUStringLiteral ARGUMENT_ENABLE_TITLEBARUPDATE - = u"EnableTitleBarUpdate"; // sal_Bool +inline constexpr OUString ARGUMENT_ENABLE_TITLEBARUPDATE = u"EnableTitleBarUpdate"_ustr; // bool + +/** [bool] enable/disable if the frame is explicitly requested to be hidden + Default = OFF ! + */ +inline constexpr OUString ARGUMENT_HIDDENFORCONVERSION = u"HiddenForConversion"_ustr; // bool /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/uiconfiguration/globalsettings.hxx b/framework/inc/uiconfiguration/globalsettings.hxx index 4730ef580b94..feb5fe8ea315 100644 --- a/framework/inc/uiconfiguration/globalsettings.hxx +++ b/framework/inc/uiconfiguration/globalsettings.hxx @@ -27,7 +27,7 @@ namespace framework class GlobalSettings { public: - GlobalSettings( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + GlobalSettings( css::uno::Reference< css::uno::XComponentContext > xContext ); ~GlobalSettings(); enum StateInfo diff --git a/framework/inc/uiconfiguration/windowstateproperties.hxx b/framework/inc/uiconfiguration/windowstateproperties.hxx index d7a394a80a86..f400dd0b54a0 100644 --- a/framework/inc/uiconfiguration/windowstateproperties.hxx +++ b/framework/inc/uiconfiguration/windowstateproperties.hxx @@ -19,21 +19,23 @@ #pragma once -#define WINDOWSTATE_PROPERTY_LOCKED "Locked" -#define WINDOWSTATE_PROPERTY_DOCKED "Docked" -#define WINDOWSTATE_PROPERTY_VISIBLE "Visible" -#define WINDOWSTATE_PROPERTY_DOCKINGAREA "DockingArea" -#define WINDOWSTATE_PROPERTY_DOCKPOS "DockPos" -#define WINDOWSTATE_PROPERTY_DOCKSIZE "DockSize" -#define WINDOWSTATE_PROPERTY_POS "Pos" -#define WINDOWSTATE_PROPERTY_SIZE "Size" -#define WINDOWSTATE_PROPERTY_UINAME "UIName" -#define WINDOWSTATE_PROPERTY_INTERNALSTATE "InternalState" -#define WINDOWSTATE_PROPERTY_STYLE "Style" -#define WINDOWSTATE_PROPERTY_CONTEXT "ContextSensitive" -#define WINDOWSTATE_PROPERTY_HIDEFROMENU "HideFromToolbarMenu" -#define WINDOWSTATE_PROPERTY_NOCLOSE "NoClose" -#define WINDOWSTATE_PROPERTY_SOFTCLOSE "SoftClose" -#define WINDOWSTATE_PROPERTY_CONTEXTACTIVE "ContextActive" +#include <rtl/ustring.hxx> + +inline constexpr OUString WINDOWSTATE_PROPERTY_LOCKED = u"Locked"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_DOCKED = u"Docked"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_VISIBLE = u"Visible"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_DOCKINGAREA = u"DockingArea"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_DOCKPOS = u"DockPos"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_DOCKSIZE = u"DockSize"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_POS = u"Pos"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_SIZE = u"Size"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_UINAME = u"UIName"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_INTERNALSTATE = u"InternalState"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_STYLE = u"Style"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_CONTEXT = u"ContextSensitive"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_HIDEFROMENU = u"HideFromToolbarMenu"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_NOCLOSE = u"NoClose"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_SOFTCLOSE = u"SoftClose"_ustr; +inline constexpr OUString WINDOWSTATE_PROPERTY_CONTEXTACTIVE = u"ContextActive"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/uielement/addonstoolbarwrapper.hxx b/framework/inc/uielement/addonstoolbarwrapper.hxx index 68cfc0ff31d0..fc09465eea5a 100644 --- a/framework/inc/uielement/addonstoolbarwrapper.hxx +++ b/framework/inc/uielement/addonstoolbarwrapper.hxx @@ -20,12 +20,13 @@ #pragma once #include <helper/uielementwrapperbase.hxx> - +#include <rtl/ref.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/uno/XComponentContext.hpp> namespace framework { +class ToolBarManager; class AddonsToolBarWrapper final : public UIElementWrapperBase { @@ -47,7 +48,7 @@ class AddonsToolBarWrapper final : public UIElementWrapperBase private: css::uno::Reference< css::uno::XComponentContext > m_xContext; - css::uno::Reference< css::lang::XComponent > m_xToolBarManager; + rtl::Reference< ToolBarManager > m_xToolBarManager; css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > m_aConfigData; bool m_bCreatedImages; }; diff --git a/framework/inc/uielement/buttontoolbarcontroller.hxx b/framework/inc/uielement/buttontoolbarcontroller.hxx index d35b3d7f2c75..759775ef8b65 100644 --- a/framework/inc/uielement/buttontoolbarcontroller.hxx +++ b/framework/inc/uielement/buttontoolbarcontroller.hxx @@ -45,9 +45,9 @@ class ButtonToolbarController final : public css::frame::XStatusListener, public ::cppu::OWeakObject { public: - ButtonToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, + ButtonToolbarController( css::uno::Reference< css::uno::XComponentContext > xContext, ToolBox* pToolBar, - const OUString& aCommand ); + OUString aCommand ); virtual ~ButtonToolbarController() override; // XInterface diff --git a/framework/inc/uielement/constitemcontainer.hxx b/framework/inc/uielement/constitemcontainer.hxx index e25edc57fc7a..ae820c29b10f 100644 --- a/framework/inc/uielement/constitemcontainer.hxx +++ b/framework/inc/uielement/constitemcontainer.hxx @@ -23,7 +23,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XFastPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <rtl/ustring.hxx> #include <cppuhelper/implbase.hxx> @@ -38,7 +37,6 @@ class RootItemContainer; class ItemContainer; class ConstItemContainer final : public ::cppu::WeakImplHelper< css::container::XIndexAccess, - css::lang::XUnoTunnel , css::beans::XFastPropertySet, css::beans::XPropertySet > { @@ -51,10 +49,6 @@ class ConstItemContainer final : public ::cppu::WeakImplHelper< ConstItemContainer( const css::uno::Reference< css::container::XIndexAccess >& rSourceContainer, bool bFastCopy = false ); virtual ~ConstItemContainer() override; - // XUnoTunnel - static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() noexcept; - sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override; - // XIndexAccess virtual sal_Int32 SAL_CALL getCount() override; @@ -82,11 +76,11 @@ class ConstItemContainer final : public ::cppu::WeakImplHelper< virtual css::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle ) override; private: - ::cppu::IPropertyArrayHelper& getInfoHelper(); - css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); + static ::cppu::IPropertyArrayHelper& getInfoHelper(); + static css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor(); void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector ); - css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer ); + static css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer ); std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector; OUString m_aUIName; diff --git a/framework/inc/uielement/fontsizemenucontroller.hxx b/framework/inc/uielement/fontsizemenucontroller.hxx index 28e64aa5741c..d04bc637a388 100644 --- a/framework/inc/uielement/fontsizemenucontroller.hxx +++ b/framework/inc/uielement/fontsizemenucontroller.hxx @@ -27,8 +27,6 @@ #include <rtl/ustring.hxx> #include <tools/long.hxx> -#include <memory> - namespace framework { class FontSizeMenuController final : public svt::PopupMenuControllerBase @@ -59,7 +57,7 @@ namespace framework void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); OUString retrievePrinterName( css::uno::Reference< css::frame::XFrame > const & rFrame ); - std::unique_ptr<tools::Long[]> m_pHeightArray; + std::vector<tools::Long> m_aHeightArray; css::frame::status::FontHeight m_aFontHeight; css::uno::Reference< css::frame::XDispatch > m_xCurrentFontDispatch; }; diff --git a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx index 0e8ecbae6ca7..f6c07c206128 100644 --- a/framework/inc/uielement/imagebuttontoolbarcontroller.hxx +++ b/framework/inc/uielement/imagebuttontoolbarcontroller.hxx @@ -46,7 +46,7 @@ class ImageButtonToolbarController final : public ComplexToolbarController private: virtual void executeControlCommand( const css::frame::ControlCommand& rControlCommand ) override; - bool ReadImageFromURL( bool bBigImage, const OUString& aImageURL, Image& aImage ); + static bool ReadImageFromURL( bool bBigImage, const OUString& aImageURL, Image& aImage ); }; } diff --git a/framework/inc/uielement/itemcontainer.hxx b/framework/inc/uielement/itemcontainer.hxx index 5d5bc9c85c41..b15514f66648 100644 --- a/framework/inc/uielement/itemcontainer.hxx +++ b/framework/inc/uielement/itemcontainer.hxx @@ -43,9 +43,6 @@ class ItemContainer final : public ::cppu::WeakImplHelper< css::container::XInde // XInterface, XTypeProvider - // XUnoTunnel - static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() noexcept; - // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; @@ -69,7 +66,7 @@ class ItemContainer final : public ::cppu::WeakImplHelper< css::container::XInde private: void copyItemContainer( const std::vector< css::uno::Sequence< css::beans::PropertyValue > >& rSourceVector, const ShareableMutex& rMutex ); - css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer, const ShareableMutex& rMutex ); + static css::uno::Reference< css::container::XIndexAccess > deepCopyContainer( const css::uno::Reference< css::container::XIndexAccess >& rSubContainer, const ShareableMutex& rMutex ); mutable ShareableMutex m_aShareMutex; std::vector< css::uno::Sequence< css::beans::PropertyValue > > m_aItemVector; diff --git a/framework/inc/uielement/langselectionmenucontroller.hxx b/framework/inc/uielement/langselectionmenucontroller.hxx index c27f42b56431..070054a2f4ac 100644 --- a/framework/inc/uielement/langselectionmenucontroller.hxx +++ b/framework/inc/uielement/langselectionmenucontroller.hxx @@ -44,9 +44,6 @@ namespace framework // XPopupMenuController virtual void SAL_CALL updatePopupMenu() override; - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -54,6 +51,9 @@ namespace framework virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: + // XInitialization + virtual void initializeImpl( std::unique_lock<std::mutex>& rGuard, const css::uno::Sequence< css::uno::Any >& aArguments ) override; + virtual void impl_setPopupMenu() override; enum Mode { diff --git a/framework/inc/uielement/macrosmenucontroller.hxx b/framework/inc/uielement/macrosmenucontroller.hxx index 7e70f0f0a3bb..7419f02a7059 100644 --- a/framework/inc/uielement/macrosmenucontroller.hxx +++ b/framework/inc/uielement/macrosmenucontroller.hxx @@ -20,7 +20,6 @@ #pragma once #include <svtools/popupmenucontrollerbase.hxx> -#include <vcl/menu.hxx> namespace framework { @@ -46,8 +45,8 @@ namespace framework virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: - void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); - void addScriptItems( PopupMenu* pPopupMenu, sal_uInt16 startItemId ); + void fillPopupMenu(const css::uno::Reference<css::awt::XPopupMenu>& rPopupMenu); + void addScriptItems(const css::uno::Reference<css::awt::XPopupMenu>& rPopupMenu, sal_uInt16 startItemId); }; } diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index a77552a67213..1beb2961e690 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <unordered_map> +#include <utility> #include <vector> #include <com/sun/star/frame/XFrame.hpp> @@ -41,8 +42,8 @@ #include <rtl/ustring.hxx> #include <vcl/menu.hxx> #include <vcl/timer.hxx> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> +#include <cppuhelper/weakref.hxx> #include <framework/addonsoptions.hxx> namespace framework @@ -56,8 +57,7 @@ struct PopupControllerEntry typedef std::unordered_map< OUString, PopupControllerEntry > PopupControllerCache; class MenuBarManager final : - protected cppu::BaseMutex, - public cppu::WeakComponentImplHelper< + public comphelper::WeakComponentImplHelper< css::frame::XStatusListener, css::frame::XFrameActionListener, css::ui::XUIConfigurationListener, @@ -121,31 +121,29 @@ class MenuBarManager final : DECL_LINK( Deactivate, Menu *, bool ); DECL_LINK( AsyncSettingsHdl, Timer *, void ); - void SAL_CALL disposing() override; + void disposing(std::unique_lock<std::mutex>&) override; void RemoveListener(); void RequestImages(); void RetrieveImageManagers(); static bool MustBeHidden( PopupMenu* pPopupMenu, const css::uno::Reference< css::util::XURLTransformer >& rTransformer ); OUString RetrieveLabelFromCommand(const OUString& rCmdURL); - void Destroy(); - struct MenuItemHandler { MenuItemHandler( sal_uInt16 aItemId, - css::uno::Reference< css::frame::XStatusListener > const & xManager, - css::uno::Reference< css::frame::XDispatch > const & rDispatch ) : + rtl::Reference< MenuBarManager > xManager, + css::uno::Reference< css::frame::XDispatch > xDispatch ) : nItemId( aItemId ), bMadeInvisible ( false ), - xSubMenuManager( xManager ), - xMenuItemDispatch( rDispatch ) {} + xSubMenuManager(std::move( xManager )), + xMenuItemDispatch(std::move( xDispatch )) {} sal_uInt16 nItemId; bool bMadeInvisible; OUString aTargetFrame; OUString aMenuItemURL; OUString aParsedItemURL; - css::uno::Reference< css::frame::XStatusListener > xSubMenuManager; + rtl::Reference< MenuBarManager > xSubMenuManager; css::uno::Reference< css::frame::XDispatch > xMenuItemDispatch; css::uno::Reference< css::frame::XPopupMenuController > xPopupMenuController; css::uno::Reference< css::awt::XPopupMenu > xPopupMenu; @@ -164,7 +162,7 @@ class MenuBarManager final : const css::uno::Reference< css::frame::XDispatchProvider >& rDispatchProvider, const OUString& rModuleIdentifier ); void AddMenu(MenuBarManager* pSubMenuManager,const OUString& _sItemCommand,sal_uInt16 _nItemId); - sal_uInt16 FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex) const; + static sal_uInt16 FillItemCommand(OUString& _rItemCommand, Menu* _pMenu,sal_uInt16 _nIndex); void SetHdl(); bool m_bDeleteMenu; diff --git a/framework/inc/uielement/menubarmerger.hxx b/framework/inc/uielement/menubarmerger.hxx index 8ff81de4580a..16bb8ec67610 100644 --- a/framework/inc/uielement/menubarmerger.hxx +++ b/framework/inc/uielement/menubarmerger.hxx @@ -60,9 +60,9 @@ struct ReferencePathInfo namespace MenuBarMerger { bool IsCorrectContext( - const OUString& aContext, std::u16string_view aModuleIdentifier ); + std::u16string_view aContext, std::u16string_view aModuleIdentifier ); - void RetrieveReferencePath( const OUString&, + void RetrieveReferencePath( std::u16string_view, std::vector< OUString >& aReferencePath ); ReferencePathInfo FindReferencePath( const std::vector< OUString >& aReferencePath, Menu* pMenu ); sal_uInt16 FindMenuItem( std::u16string_view rCmd, @@ -75,7 +75,7 @@ namespace MenuBarMerger sal_uInt16 nPos, sal_uInt16& rItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const OUString& rModuleIdentifier, const AddonMenuContainer& rAddonMenuItems ); bool ProcessFallbackOperation( const ReferencePathInfo& aRefPathInfo, @@ -98,7 +98,7 @@ namespace MenuBarMerger const AddonMenuContainer& rAddonMenuItems ); bool RemoveMenuItems( Menu* pMenu, sal_uInt16 nPos, - const OUString& rMergeCommandParameter ); + std::u16string_view rMergeCommandParameter ); bool CreateSubMenu( Menu* pSubMenu, sal_uInt16& nItemId, const OUString& rModuleIdentifier, diff --git a/framework/inc/uielement/menubarwrapper.hxx b/framework/inc/uielement/menubarwrapper.hxx index 66a5716a8f0d..848af5c693f7 100644 --- a/framework/inc/uielement/menubarwrapper.hxx +++ b/framework/inc/uielement/menubarwrapper.hxx @@ -28,23 +28,15 @@ namespace framework { -class MenuBarWrapper final : public UIConfigElementWrapperBase, - public css::container::XNameAccess +typedef cppu::ImplInheritanceHelper< UIConfigElementWrapperBase, css::container::XNameAccess> MenuBarWrapper_Base; +class MenuBarWrapper final : public MenuBarWrapper_Base { public: - MenuBarWrapper( - const css::uno::Reference< css::uno::XComponentContext >& xContext ); + MenuBarWrapper( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~MenuBarWrapper() override; - // XInterface, XTypeProvider - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override; - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override; - - MenuBarManager* GetMenuBarManager() const { return static_cast< MenuBarManager* >( m_xMenuBarManager.get() ); } + MenuBarManager* GetMenuBarManager() const { return m_xMenuBarManager.get(); } // XComponent virtual void SAL_CALL dispose() override; @@ -72,7 +64,7 @@ class MenuBarWrapper final : public UIConfigElementWrapperBase, void fillPopupControllerCache(); bool m_bRefreshPopupControllerCache : 1; - css::uno::Reference< css::lang::XComponent > m_xMenuBarManager; + rtl::Reference< MenuBarManager > m_xMenuBarManager; PopupControllerCache m_aPopupControllerCache; css::uno::Reference< css::uno::XComponentContext > m_xContext; }; diff --git a/framework/inc/uielement/newmenucontroller.hxx b/framework/inc/uielement/newmenucontroller.hxx index 2c745cc2b64d..abc10e03e678 100644 --- a/framework/inc/uielement/newmenucontroller.hxx +++ b/framework/inc/uielement/newmenucontroller.hxx @@ -40,9 +40,6 @@ namespace framework virtual sal_Bool SAL_CALL supportsService( const OUString& sServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -54,14 +51,17 @@ namespace framework virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: + // XInitialization + virtual void initializeImpl( std::unique_lock<std::mutex>& rGuard, const css::uno::Sequence< css::uno::Any >& aArguments ) override; + virtual void impl_setPopupMenu() override; void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); - void retrieveShortcutsFromConfiguration( const css::uno::Reference< css::ui::XAcceleratorConfiguration >& rAccelCfg, + static void retrieveShortcutsFromConfiguration( const css::uno::Reference< css::ui::XAcceleratorConfiguration >& rAccelCfg, const css::uno::Sequence< OUString >& rCommands, std::vector< vcl::KeyCode >& aMenuShortCuts ); - void setAccelerators( PopupMenu* pPopupMenu ); - void determineAndSetNewDocAccel( PopupMenu* pPopupMenu, const vcl::KeyCode& rKeyCode ); + void setAccelerators(); + void determineAndSetNewDocAccel(const css::awt::KeyEvent& rKeyCode); void setMenuImages( PopupMenu* pPopupMenu, bool bSetImages ); private: diff --git a/framework/inc/uielement/rootitemcontainer.hxx b/framework/inc/uielement/rootitemcontainer.hxx index cdfc82fada3e..159137f0f67e 100644 --- a/framework/inc/uielement/rootitemcontainer.hxx +++ b/framework/inc/uielement/rootitemcontainer.hxx @@ -25,7 +25,6 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <rtl/ustring.hxx> #include <cppuhelper/basemutex.hxx> @@ -40,8 +39,7 @@ class ConstItemContainer; typedef ::cppu::WeakImplHelper< css::container::XIndexContainer, - css::lang::XSingleComponentFactory, - css::lang::XUnoTunnel > RootItemContainer_BASE; + css::lang::XSingleComponentFactory > RootItemContainer_BASE; class RootItemContainer final : private cppu::BaseMutex, public ::cppu::OBroadcastHelper , @@ -65,10 +63,6 @@ class RootItemContainer final : private cppu::BaseMutex, // XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; - // XUnoTunnel - static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId() noexcept; - sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rIdentifier ) override; - // XIndexContainer virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; diff --git a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx index 609f4ec012e1..796a5e00b277 100644 --- a/framework/inc/uielement/spinfieldtoolbarcontroller.hxx +++ b/framework/inc/uielement/spinfieldtoolbarcontroller.hxx @@ -57,7 +57,7 @@ class SpinfieldToolbarController final : public ComplexToolbarController virtual void executeControlCommand( const css::frame::ControlCommand& rControlCommand ) override; virtual css::uno::Sequence< css::beans::PropertyValue> getExecuteArgs(sal_Int16 KeyModifier) const override; - bool impl_getValue( const css::uno::Any& rAny, sal_Int32& nValue, double& fValue, bool& bFloat ); + static bool impl_getValue( const css::uno::Any& rAny, sal_Int32& nValue, double& fValue, bool& bFloat ); bool m_bFloat; double m_nMax; diff --git a/framework/inc/uielement/statusbaritem.hxx b/framework/inc/uielement/statusbaritem.hxx index 62e3c1f4e62e..b9597bd2ab57 100644 --- a/framework/inc/uielement/statusbaritem.hxx +++ b/framework/inc/uielement/statusbaritem.hxx @@ -19,8 +19,7 @@ #pragma once #include <com/sun/star/ui/XStatusbarItem.hpp> -#include <cppuhelper/compbase.hxx> -#include <cppuhelper/basemutex.hxx> +#include <comphelper/compbase.hxx> #include <vcl/vclptr.hxx> class StatusBar; @@ -30,19 +29,18 @@ namespace framework struct AddonStatusbarItemData; -typedef cppu::WeakComponentImplHelper< css::ui::XStatusbarItem > StatusbarItem_Base; +typedef comphelper::WeakComponentImplHelper< css::ui::XStatusbarItem > StatusbarItem_Base; -class StatusbarItem final : protected cppu::BaseMutex, - public StatusbarItem_Base +class StatusbarItem final : public StatusbarItem_Base { public: explicit StatusbarItem( StatusBar *pStatusBar, sal_uInt16 nId, - const OUString& aCommand ); + OUString aCommand ); virtual ~StatusbarItem() override; - void SAL_CALL disposing() override; + void disposing(std::unique_lock<std::mutex>&) override; // css::ui::XStatusbarItem Attributes virtual OUString SAL_CALL getCommand() override; diff --git a/framework/inc/uielement/statusbarmanager.hxx b/framework/inc/uielement/statusbarmanager.hxx index 99cf94ea1d59..c893e4abdc69 100644 --- a/framework/inc/uielement/statusbarmanager.hxx +++ b/framework/inc/uielement/statusbarmanager.hxx @@ -26,10 +26,11 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase.hxx> -#include <comphelper/multicontainer2.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <vcl/status.hxx> #include <vcl/vclptr.hxx> #include <map> +#include <mutex> namespace framework { @@ -44,8 +45,8 @@ class StatusBarManager final: public ::cppu::WeakImplHelper< friend class FrameworkStatusBar; public: - StatusBarManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext, - const css::uno::Reference< css::frame::XFrame >& rFrame, + StatusBarManager( css::uno::Reference< css::uno::XComponentContext > xContext, + css::uno::Reference< css::frame::XFrame > xFrame, StatusBar* pStatusBar ); virtual ~StatusBarManager() override; @@ -92,8 +93,8 @@ class StatusBarManager final: public ::cppu::WeakImplHelper< VclPtr<StatusBar> m_pStatusBar; css::uno::Reference< css::frame::XFrame > m_xFrame; StatusBarControllerMap m_aControllerMap; - osl::Mutex m_mutex; - comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener + std::mutex m_mutex; + comphelper::OInterfaceContainerHelper4<XEventListener> m_aListenerContainer; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XUIControllerFactory > m_xStatusbarControllerFactory; }; diff --git a/framework/inc/uielement/statusbarmerger.hxx b/framework/inc/uielement/statusbarmerger.hxx index 350bae4bf2f8..1eaec5a88f81 100644 --- a/framework/inc/uielement/statusbarmerger.hxx +++ b/framework/inc/uielement/statusbarmerger.hxx @@ -60,7 +60,7 @@ namespace StatusbarMerger sal_uInt16 nPos, sal_uInt16& rItemId, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonStatusbarItemContainer& rItems ); bool ProcessMergeFallback( StatusBar* pStatusbar, diff --git a/framework/inc/uielement/statusbarwrapper.hxx b/framework/inc/uielement/statusbarwrapper.hxx index 84b2befb459d..c281b4f4866f 100644 --- a/framework/inc/uielement/statusbarwrapper.hxx +++ b/framework/inc/uielement/statusbarwrapper.hxx @@ -20,18 +20,19 @@ #pragma once #include <helper/uiconfigelementwrapperbase.hxx> - +#include <rtl/ref.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/uno/XComponentContext.hpp> namespace framework { +class StatusBarManager; class StatusBarWrapper final : public UIConfigElementWrapperBase { public: StatusBarWrapper( - const css::uno::Reference< css::uno::XComponentContext >& rxContext ); + css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~StatusBarWrapper() override; // XComponent @@ -47,7 +48,7 @@ class StatusBarWrapper final : public UIConfigElementWrapperBase virtual void SAL_CALL updateSettings() override; private: - css::uno::Reference< css::lang::XComponent > m_xStatusBarManager; + rtl::Reference< StatusBarManager > m_xStatusBarManager; css::uno::Reference< css::uno::XComponentContext > m_xContext; }; diff --git a/framework/inc/uielement/styletoolbarcontroller.hxx b/framework/inc/uielement/styletoolbarcontroller.hxx index b7bbd8a11782..45b1ad7eccce 100644 --- a/framework/inc/uielement/styletoolbarcontroller.hxx +++ b/framework/inc/uielement/styletoolbarcontroller.hxx @@ -34,7 +34,7 @@ class StyleDispatcher final : public cppu::WeakImplHelper< css::frame::XDispatch { public: StyleDispatcher( const css::uno::Reference< css::frame::XFrame >& rFrame, - const css::uno::Reference< css::util::XURLTransformer >& rUrlTransformer, + css::uno::Reference< css::util::XURLTransformer > xUrlTransformer, const css::util::URL& rURL ); // XDispatch diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index a12528415184..6af5e93aea65 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -37,7 +37,7 @@ #include <rtl/ustring.hxx> #include <cppuhelper/implbase.hxx> -#include <comphelper/multicontainer2.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <tools/link.hxx> #include <vcl/weld.hxx> @@ -45,6 +45,7 @@ #include <vcl/timer.hxx> #include <vcl/toolbox.hxx> +#include <mutex> #include <unordered_map> class PopupMenu; @@ -54,6 +55,7 @@ class Menu; namespace framework { +class ImageOrientationController; class ToolBarManager; class ToolBarManagerImpl @@ -63,12 +65,7 @@ public: virtual void Init() = 0; virtual void Destroy() = 0; virtual css::uno::Reference<css::awt::XWindow> GetInterface() = 0; - virtual css::uno::Reference<css::frame::XStatusListener> CreateToolBoxController( - const css::uno::Reference<css::frame::XFrame>& rFrame, - ToolBoxItemId nId, - const OUString& aCommandURL ) = 0; virtual void InsertItem(ToolBoxItemId nId, - const OUString& rString, const OUString& rCommandURL, const OUString& rTooltip, const OUString& rLabel, @@ -85,7 +82,7 @@ public: virtual bool IsItemVisible(ToolBoxItemId nId, const OUString& rCommandURL) = 0; virtual void Clear() = 0; virtual void SetName(const OUString& rName) = 0; - virtual void SetHelpId(const OString& rHelpId) = 0; + virtual void SetHelpId(const OUString& rHelpId) = 0; virtual bool WillUsePopupMode() = 0; virtual bool IsReallyVisible() = 0; virtual void SetIconSize(ToolBoxButtonSize eSize) = 0; @@ -93,6 +90,7 @@ public: virtual void ConnectCallbacks(ToolBarManager* pManager) = 0; virtual void SetMenuType(ToolBoxMenuType eType) = 0; virtual void MergeToolbar(ToolBoxItemId & rItemId, + sal_uInt16 nFirstItem, const OUString& rModuleIdentifier, CommandToInfoMap& rCommandMap, MergeToolbarInstruction& rInstruction) = 0; @@ -114,11 +112,11 @@ class ToolBarManager final : public ToolbarManager_Base public: ToolBarManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, - const OUString& rResourceName, + OUString aResourceName, ToolBox* pToolBar ); ToolBarManager( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, - const OUString& rResourceName, + OUString aResourceName, weld::Toolbar* pToolBar, weld::Builder* pBuilder ); virtual ~ToolBarManager() override; @@ -143,7 +141,9 @@ class ToolBarManager final : public ToolbarManager_Base void CheckAndUpdateImages(); void RequestImages(); - void FillToolbar( const css::uno::Reference< css::container::XIndexAccess >& rToolBarData ); + void FillToolbar( const css::uno::Reference< css::container::XIndexAccess >& rToolBarData, + const css::uno::Reference< css::container::XIndexAccess >& rContextData, + const OUString& rContextToolbarName ); void FillAddonToolbar( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rAddonToolbar ); void FillOverflowToolbar( ToolBox const * pParent ); void notifyRegisteredControllers( const OUString& aUIElementName, const OUString& aCommand ); @@ -192,6 +192,9 @@ class ToolBarManager final : public ToolbarManager_Base private: void Init(); + void FillToolbarFromContainer(const css::uno::Reference< css::container::XIndexAccess >& rItemContainer, + const OUString& rResourceName, ToolBoxItemId& nId, ToolBoxItemId& nAddonId); + void ToggleButton(const OUString& rResourceName, std::u16string_view rCommand); void AddCustomizeMenuItems(ToolBox const * pToolBar); void InitImageManager(); void RemoveControllers(); @@ -202,7 +205,7 @@ class ToolBarManager final : public ToolbarManager_Base //end void AddFrameActionListener(); void RefreshImages(); - ToolBoxItemBits ConvertStyleToToolboxItemBits( sal_Int32 nStyle ); + static ToolBoxItemBits ConvertStyleToToolboxItemBits( sal_Int32 nStyle ); css::uno::Reference< css::frame::XModel > GetModelFromFrame() const; bool IsPluginMode() const; void HandleClick(ClickAction eAction); @@ -218,18 +221,21 @@ class ToolBarManager final : public ToolbarManager_Base m_bUpdateControllers : 1; sal_Int16 m_eSymbolSize; + sal_uInt16 m_nContextMinPos; std::unique_ptr<ToolBarManagerImpl> m_pImpl; VclPtr<ToolBox> m_pToolBar; + weld::Toolbar* m_pWeldedToolBar; OUString m_aModuleIdentifier; OUString m_aResourceName; + OUString m_aContextResourceName; css::uno::Reference< css::util::XURLTransformer > m_xURLTransformer; css::uno::Reference< css::frame::XFrame > m_xFrame; ToolBarControllerMap m_aControllerMap; - osl::Mutex m_mutex; - comphelper::OMultiTypeInterfaceContainerHelper2 m_aListenerContainer; /// container for ALL Listener + std::mutex m_mutex; + comphelper::OInterfaceContainerHelper4<XEventListener> m_aListenerContainer; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::frame::XUIControllerFactory > m_xToolbarControllerFactory; css::uno::Reference< css::ui::XImageManager > m_xModuleImageManager; @@ -241,6 +247,7 @@ class ToolBarManager final : public ToolbarManager_Base OUString m_sIconTheme; rtl::Reference< ToolBarManager > m_aOverflowManager; + rtl::Reference< ImageOrientationController > m_aImageController; }; } diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx index ccfa73ad4d9e..b84ca2005e39 100644 --- a/framework/inc/uielement/toolbarmerger.hxx +++ b/framework/inc/uielement/toolbarmerger.hxx @@ -62,7 +62,7 @@ struct ReferenceToolbarPathInfo class ToolBarMerger { public: - static bool IsCorrectContext( const OUString& aContext, std::u16string_view aModuleIdentifier ); + static bool IsCorrectContext( std::u16string_view aContext, std::u16string_view aModuleIdentifier ); static void ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence, AddonToolbarItemContainer& rContainer ); @@ -75,7 +75,7 @@ class ToolBarMerger OUString& rControlType, sal_uInt16& rWidth ); - static ReferenceToolbarPathInfo FindReferencePoint( const ToolBox* pToolbar, + static ReferenceToolbarPathInfo FindReferencePoint( const ToolBox* pToolbar, sal_uInt16 nFirstItem, std::u16string_view rReferencePoint ); static bool ProcessMergeOperation( ToolBox* pToolbar, @@ -84,7 +84,7 @@ class ToolBarMerger CommandToInfoMap& rCommandMap, std::u16string_view rModuleIdentifier, std::u16string_view rMergeCommand, - const OUString& rMergeCommandParameter, + std::u16string_view rMergeCommandParameter, const AddonToolbarItemContainer& rItems ); static bool ProcessMergeFallback( ToolBox* pToolbar, @@ -112,7 +112,7 @@ class ToolBarMerger static void RemoveItems( ToolBox* pToolbar, ToolBox::ImplToolItems::size_type nPos, - const OUString& rMergeCommandParameter ); + std::u16string_view rMergeCommandParameter ); static rtl::Reference<::cppu::OWeakObject> CreateController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, diff --git a/framework/inc/uielement/toolbarsmenucontroller.hxx b/framework/inc/uielement/toolbarsmenucontroller.hxx index 99d64775d6b6..23d07ef509d6 100644 --- a/framework/inc/uielement/toolbarsmenucontroller.hxx +++ b/framework/inc/uielement/toolbarsmenucontroller.hxx @@ -48,9 +48,6 @@ namespace framework // XPopupMenuController virtual void SAL_CALL setPopupMenu( const css::uno::Reference< css::awt::XPopupMenu >& PopupMenu ) override; - // XInitialization - virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; - // XStatusListener virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override; @@ -64,15 +61,17 @@ namespace framework struct ExecuteInfo { css::uno::Reference< css::frame::XDispatch > xDispatch; - css::util::URL aTargetURL; - css::uno::Sequence< css::beans::PropertyValue > aArgs; + css::util::URL aTargetURL; }; DECL_STATIC_LINK( ToolbarsMenuController, ExecuteHdl_Impl, void*, void ); private: + // XInitialization + virtual void initializeImpl( std::unique_lock<std::mutex>& rGuard, const css::uno::Sequence< css::uno::Any >& aArguments ) override; + void fillPopupMenu( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu ); - css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getLayoutManagerToolbars( const css::uno::Reference< css::frame::XLayoutManager >& rLayoutManager ); + static css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getLayoutManagerToolbars( const css::uno::Reference< css::frame::XLayoutManager >& rLayoutManager ); css::uno::Reference< css::frame::XDispatch > getDispatchFromCommandURL( const OUString& rCommandURL ); void addCommand( css::uno::Reference< css::awt::XPopupMenu > const & rPopupMenu, const OUString& rCommandURL, const OUString& aLabel ); diff --git a/framework/inc/uielement/toolbarwrapper.hxx b/framework/inc/uielement/toolbarwrapper.hxx index 55142f98d500..6325c0b54183 100644 --- a/framework/inc/uielement/toolbarwrapper.hxx +++ b/framework/inc/uielement/toolbarwrapper.hxx @@ -23,7 +23,10 @@ #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/ui/XUIFunctionListener.hpp> +#include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <rtl/ref.hxx> +#include <memory> namespace weld { @@ -34,20 +37,16 @@ namespace weld namespace framework { - class ToolBarManager; -class ToolBarWrapper final : public css::ui::XUIFunctionListener, - public UIConfigElementWrapperBase + +class ToolBarWrapper final : public cppu::ImplInheritanceHelper<UIConfigElementWrapperBase, + css::ui::XUIFunctionListener, + css::ui::XContextChangeEventListener> { public: ToolBarWrapper( const css::uno::Reference< css::uno::XComponentContext >& xContext ); virtual ~ToolBarWrapper() override; - // XInterface - virtual void SAL_CALL acquire() noexcept override; - virtual void SAL_CALL release() noexcept override; - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - // XComponent virtual void SAL_CALL dispose() override; @@ -66,6 +65,9 @@ class ToolBarWrapper final : public css::ui::XUIFunctionListener, // XUIFunctionListener virtual void SAL_CALL functionExecute( const OUString& aUIElementName, const OUString& aCommand ) override; + // XContextChangeEventListener + virtual void SAL_CALL notifyContextChangeEvent( const css::ui::ContextChangeEventObject& aEvent ) override; + // XEventListener using cppu::OPropertySetHelper::disposing; virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override; @@ -74,8 +76,9 @@ class ToolBarWrapper final : public css::ui::XUIFunctionListener, virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const css::uno::Any& aValue ) override; virtual void impl_fillNewData() override; - css::uno::Reference< css::lang::XComponent > m_xToolBarManager; + rtl::Reference< ToolBarManager > m_xToolBarManager; css::uno::Reference< css::uno::XComponentContext > m_xContext; + css::uno::Reference< css::ui::XUIElement > m_xSubElement; std::unique_ptr<weld::Builder> m_xBuilder; std::unique_ptr<weld::Container> m_xTopLevel; diff --git a/framework/inc/uielement/uicommanddescription.hxx b/framework/inc/uielement/uicommanddescription.hxx index 146b4f42db3a..aeeb1f9aa216 100644 --- a/framework/inc/uielement/uicommanddescription.hxx +++ b/framework/inc/uielement/uicommanddescription.hxx @@ -26,19 +26,17 @@ #include <com/sun/star/frame/XModuleManager2.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <cppuhelper/basemutex.hxx> -#include <cppuhelper/compbase.hxx> +#include <comphelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> #include <rtl/ustring.hxx> #include <i18nlangtag/languagetag.hxx> namespace framework { -typedef ::cppu::WeakComponentImplHelper< css::lang::XServiceInfo, +typedef comphelper::WeakComponentImplHelper< css::lang::XServiceInfo, css::container::XNameAccess > UICommandDescription_BASE; -class UICommandDescription : private cppu::BaseMutex, - public UICommandDescription_BASE +class UICommandDescription : public UICommandDescription_BASE { public: UICommandDescription( const css::uno::Reference< css::uno::XComponentContext >& rxContext ); diff --git a/framework/inc/uielement/uielement.hxx b/framework/inc/uielement/uielement.hxx index f236f943082b..8e6f0c7de470 100644 --- a/framework/inc/uielement/uielement.hxx +++ b/framework/inc/uielement/uielement.hxx @@ -25,6 +25,7 @@ #include <com/sun/star/awt/Size.hpp> #include <rtl/ustring.hxx> +#include <utility> #include <vcl/toolbox.hxx> namespace framework @@ -65,12 +66,12 @@ struct UIElement m_nStyle( ButtonType::SYMBOLONLY ) {} - UIElement( const OUString& rName, - const OUString& rType, - const css::uno::Reference< css::ui::XUIElement >& rUIElement - ) : m_aType( rType ), - m_aName( rName ), - m_xUIElement( rUIElement ), + UIElement( OUString aName, + OUString aType, + css::uno::Reference< css::ui::XUIElement > xUIElement + ) : m_aType(std::move( aType )), + m_aName(std::move( aName )), + m_xUIElement(std::move( xUIElement )), m_bFloating( false ), m_bVisible( true ), m_bUserActive( false ), diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx b/framework/inc/uifactory/configurationaccessfactorymanager.hxx index 7b12048e1223..af0345b496e9 100644 --- a/framework/inc/uifactory/configurationaccessfactorymanager.hxx +++ b/framework/inc/uifactory/configurationaccessfactorymanager.hxx @@ -30,6 +30,7 @@ #include <cppuhelper/implbase.hxx> #include <rtl/ustring.hxx> +#include <mutex> #include <string_view> #include <unordered_map> @@ -38,12 +39,12 @@ namespace framework { class ConfigurationAccess_FactoryManager final : public ::cppu::WeakImplHelper< css::container::XContainerListener> { public: - ConfigurationAccess_FactoryManager( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const OUString& _sRoot ); + ConfigurationAccess_FactoryManager( const css::uno::Reference< css::uno::XComponentContext>& rxContext, OUString _sRoot ); virtual ~ConfigurationAccess_FactoryManager() override; void readConfigurationData(); - OUString getFactorySpecifierFromTypeNameModule( std::u16string_view rType, const OUString& rName, std::u16string_view rModule ) const; + OUString getFactorySpecifierFromTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule ) const; void addFactorySpecifierToTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule, const OUString& aServiceSpecifier ); void removeFactorySpecifierFromTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule ); css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getFactoriesDescription() const; @@ -64,7 +65,7 @@ class ConfigurationAccess_FactoryManager final : public ::cppu::WeakImplHelper< bool impl_getElementProps( const css::uno::Any& rElement, OUString& rType, OUString& rName, OUString& rModule, OUString& rServiceSpecifier ) const; - mutable osl::Mutex m_aMutex; + mutable std::mutex m_aMutex; OUString m_aPropType; OUString m_aPropName; OUString m_aPropModule; diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx index 1ba2a622c74c..4e5ea6c4b052 100644 --- a/framework/inc/uifactory/factoryconfiguration.hxx +++ b/framework/inc/uifactory/factoryconfiguration.hxx @@ -27,8 +27,10 @@ #include <cppuhelper/implbase.hxx> #include <rtl/ustring.hxx> +#include <mutex> #include <string_view> #include <unordered_map> +#include <utility> // Namespace @@ -41,11 +43,10 @@ class ConfigurationAccess_ControllerFactory final : // interfaces public ::cppu::WeakImplHelper< css::container::XContainerListener> { public: - ConfigurationAccess_ControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const OUString& _sRoot ); + ConfigurationAccess_ControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString _sRoot ); virtual ~ConfigurationAccess_ControllerFactory() override; void readConfigurationData(); - void updateConfigurationData(); OUString getServiceFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const; OUString getValueFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const; @@ -61,11 +62,13 @@ public: virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override; private: + void updateConfigurationDataImpl(); + struct ControllerInfo { OUString m_aImplementationName; OUString m_aValue; - ControllerInfo(const OUString& _aImplementationName,const OUString& _aValue) : m_aImplementationName(_aImplementationName),m_aValue(_aValue){} + ControllerInfo(OUString _aImplementationName, OUString _aValue) : m_aImplementationName(std::move(_aImplementationName)),m_aValue(std::move(_aValue)){} ControllerInfo(){} }; class MenuControllerMap : public std::unordered_map< OUString, @@ -75,7 +78,7 @@ private: bool impl_getElementProps( const css::uno::Any& aElement, OUString& aCommand, OUString& aModule, OUString& aServiceSpecifier,OUString& aValue ) const; - mutable osl::Mutex m_mutex; + mutable std::mutex m_mutex; OUString m_aPropCommand; OUString m_aPropModule; OUString m_aPropController; diff --git a/framework/inc/uifactory/menubarfactory.hxx b/framework/inc/uifactory/menubarfactory.hxx index 9019928182d7..a3ec76daa143 100644 --- a/framework/inc/uifactory/menubarfactory.hxx +++ b/framework/inc/uifactory/menubarfactory.hxx @@ -37,7 +37,7 @@ typedef ::cppu::WeakImplHelper< class MenuBarFactory : public MenuBarFactory_BASE { public: - MenuBarFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext ); + MenuBarFactory( css::uno::Reference< css::uno::XComponentContext > xContext ); virtual ~MenuBarFactory() override; virtual OUString SAL_CALL getImplementationName() override diff --git a/framework/inc/xml/acceleratorconfigurationwriter.hxx b/framework/inc/xml/acceleratorconfigurationwriter.hxx index ce28896b1118..149a72f33632 100644 --- a/framework/inc/xml/acceleratorconfigurationwriter.hxx +++ b/framework/inc/xml/acceleratorconfigurationwriter.hxx @@ -55,7 +55,7 @@ class AcceleratorConfigurationWriter final used to write the configuration there. */ AcceleratorConfigurationWriter(const AcceleratorCache& rContainer, - const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig ); + css::uno::Reference< css::xml::sax::XDocumentHandler > xConfig ); /** @short does nothing real ... */ ~AcceleratorConfigurationWriter(); @@ -68,7 +68,7 @@ class AcceleratorConfigurationWriter final private: /** @short TODO */ - void impl_ts_writeKeyCommandPair(const css::awt::KeyEvent& aKey , + static void impl_ts_writeKeyCommandPair(const css::awt::KeyEvent& aKey , const OUString& sCommand, const css::uno::Reference< css::xml::sax::XDocumentHandler >& xConfig ); }; diff --git a/framework/inc/xml/imagesdocumenthandler.hxx b/framework/inc/xml/imagesdocumenthandler.hxx index d8cd84f4dfe4..ccdbe0e5b4cf 100644 --- a/framework/inc/xml/imagesdocumenthandler.hxx +++ b/framework/inc/xml/imagesdocumenthandler.hxx @@ -123,7 +123,6 @@ class OWriteImagesDocumentHandler final css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; OUString m_aXMLImageNS; - OUString m_aAttributeType; OUString m_aAttributeXlinkType; OUString m_aAttributeValueSimple; }; diff --git a/framework/inc/xml/menudocumenthandler.hxx b/framework/inc/xml/menudocumenthandler.hxx index f3a0238d0bd7..db72eb9171c2 100644 --- a/framework/inc/xml/menudocumenthandler.hxx +++ b/framework/inc/xml/menudocumenthandler.hxx @@ -213,7 +213,6 @@ class OWriteMenuDocumentHandler final css::uno::Reference< css::container::XIndexAccess > m_xMenuBarContainer; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xWriteDocumentHandler; css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; - OUString m_aAttributeType; bool m_bIsMenuBar; }; diff --git a/framework/inc/xml/statusbardocumenthandler.hxx b/framework/inc/xml/statusbardocumenthandler.hxx index 829cd0b9745a..ba1ef7c364f8 100644 --- a/framework/inc/xml/statusbardocumenthandler.hxx +++ b/framework/inc/xml/statusbardocumenthandler.hxx @@ -125,7 +125,6 @@ class OWriteStatusBarDocumentHandler final css::uno::Reference< css::xml::sax::XAttributeList > m_xEmptyList; OUString m_aXMLStatusBarNS; OUString m_aXMLXlinkNS; - OUString m_aAttributeType; OUString m_aAttributeURL; }; diff --git a/framework/inc/xml/toolboxconfigurationdefines.hxx b/framework/inc/xml/toolboxconfigurationdefines.hxx index c84adff58e8b..39f77f3f4c1d 100644 --- a/framework/inc/xml/toolboxconfigurationdefines.hxx +++ b/framework/inc/xml/toolboxconfigurationdefines.hxx @@ -18,9 +18,11 @@ */ #pragma once +#include <rtl/ustring.hxx> + #define XMLNS_TOOLBAR "http://openoffice.org/2001/toolbar" #define XMLNS_XLINK "http://www.w3.org/1999/xlink" -#define XMLNS_TOOLBAR_PREFIX "toolbar:" +inline constexpr OUString XMLNS_TOOLBAR_PREFIX = u"toolbar:"_ustr; #define XMLNS_XLINK_PREFIX "xlink:" #define XMLNS_FILTER_SEPARATOR "^" @@ -38,28 +40,26 @@ #define ATTRIBUTE_VISIBLE "visible" #define ATTRIBUTE_ITEMSTYLE "style" -#define ELEMENT_NS_TOOLBAR "toolbar:toolbar" -#define ELEMENT_NS_TOOLBARITEM "toolbar:toolbaritem" -#define ELEMENT_NS_TOOLBARSPACE "toolbar:toolbarspace" -#define ELEMENT_NS_TOOLBARBREAK "toolbar:toolbarbreak" -#define ELEMENT_NS_TOOLBARSEPARATOR "toolbar:toolbarseparator" - -#define ATTRIBUTE_XMLNS_TOOLBAR "xmlns:toolbar" -#define ATTRIBUTE_XMLNS_XLINK "xmlns:xlink" +inline constexpr OUString ELEMENT_NS_TOOLBAR = u"toolbar:toolbar"_ustr; +inline constexpr OUString ELEMENT_NS_TOOLBARITEM = u"toolbar:toolbaritem"_ustr; +inline constexpr OUString ELEMENT_NS_TOOLBARSPACE = u"toolbar:toolbarspace"_ustr; +inline constexpr OUString ELEMENT_NS_TOOLBARBREAK = u"toolbar:toolbarbreak"_ustr; +inline constexpr OUString ELEMENT_NS_TOOLBARSEPARATOR = u"toolbar:toolbarseparator"_ustr; -#define ATTRIBUTE_TYPE_CDATA "CDATA" +inline constexpr OUString ATTRIBUTE_XMLNS_TOOLBAR = u"xmlns:toolbar"_ustr; +inline constexpr OUString ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"_ustr; #define ATTRIBUTE_BOOLEAN_TRUE "true" -#define ATTRIBUTE_BOOLEAN_FALSE "false" +inline constexpr OUString ATTRIBUTE_BOOLEAN_FALSE = u"false"_ustr; -#define ATTRIBUTE_ITEMSTYLE_RADIO "radio" -#define ATTRIBUTE_ITEMSTYLE_AUTO "auto" -#define ATTRIBUTE_ITEMSTYLE_LEFT "left" -#define ATTRIBUTE_ITEMSTYLE_AUTOSIZE "autosize" -#define ATTRIBUTE_ITEMSTYLE_DROPDOWN "dropdown" -#define ATTRIBUTE_ITEMSTYLE_REPEAT "repeat" -#define ATTRIBUTE_ITEMSTYLE_TEXT "text" -#define ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY "dropdownonly" -#define ATTRIBUTE_ITEMSTYLE_IMAGE "image" +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_RADIO = u"radio"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_AUTO = u"auto"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_LEFT = u"left"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_AUTOSIZE = u"autosize"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_DROPDOWN = u"dropdown"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_REPEAT = u"repeat"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_TEXT = u"text"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY = u"dropdownonly"_ustr; +inline constexpr OUString ATTRIBUTE_ITEMSTYLE_IMAGE = u"image"_ustr; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx index 79657e5324e4..f134054267ae 100644 --- a/framework/inc/xml/toolboxdocumenthandler.hxx +++ b/framework/inc/xml/toolboxdocumenthandler.hxx @@ -100,14 +100,6 @@ class OReadToolBoxDocumentHandler final : public OReadToolBoxDocumentHandler_Bas css::uno::Reference< css::container::XIndexContainer > m_rItemContainer; css::uno::Reference< css::xml::sax::XLocator > m_xLocator; - sal_Int32 m_nHashCode_Style_Radio; - sal_Int32 m_nHashCode_Style_Left; - sal_Int32 m_nHashCode_Style_AutoSize; - sal_Int32 m_nHashCode_Style_DropDown; - sal_Int32 m_nHashCode_Style_Repeat; - sal_Int32 m_nHashCode_Style_DropDownOnly; - sal_Int32 m_nHashCode_Style_Text; - sal_Int32 m_nHashCode_Style_Image; OUString m_aType; OUString m_aLabel; OUString m_aStyle; @@ -149,7 +141,6 @@ class OWriteToolBoxDocumentHandler final css::uno::Reference< css::container::XIndexAccess > m_rItemAccess; OUString m_aXMLToolbarNS; OUString m_aXMLXlinkNS; - OUString m_aAttributeType; OUString m_aAttributeURL; }; |