framework/inc/acceleratorconst.h | 6 - framework/inc/bitmaps.hlst | 48 +++++----- framework/inc/classes/actiontriggercontainer.hxx | 4 framework/inc/classes/actiontriggerpropertyset.hxx | 4 framework/inc/classes/actiontriggerseparatorpropertyset.hxx | 4 framework/inc/classes/protocolhandlercache.hxx | 2 framework/inc/classes/rootactiontriggercontainer.hxx | 2 framework/inc/properties.h | 42 ++++---- framework/inc/services.h | 16 +-- framework/inc/targets.h | 12 +- framework/inc/taskcreatordefs.hxx | 10 +- framework/inc/uiconfiguration/windowstateproperties.hxx | 34 +++---- framework/inc/xml/toolboxconfigurationdefines.hxx | 38 +++---- framework/source/layoutmanager/helpers.hxx | 4 framework/source/uiconfiguration/windowstateconfiguration.cxx | 13 -- framework/source/uielement/controlmenucontroller.cxx | 42 ++++---- framework/source/xml/imagesdocumenthandler.cxx | 2 include/framework/addonsoptions.hxx | 16 +-- 18 files changed, 150 insertions(+), 149 deletions(-)
New commits: commit c4499bef94845176b53bbe9678d242638d86040c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Nov 25 14:51:21 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Nov 26 09:47:52 2021 +0100 loplugin:stringliteraldefine in framework Change-Id: I8bdda62c232b8f20aa6bb1e5e7ad303d6ffa47ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125809 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/framework/inc/acceleratorconst.h b/framework/inc/acceleratorconst.h index e75b5be04b02..83fd40ac77f7 100644 --- a/framework/inc/acceleratorconst.h +++ b/framework/inc/acceleratorconst.h @@ -21,11 +21,11 @@ namespace framework{ -#define ATTRIBUTE_TYPE_CDATA "CDATA" +inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; // same items with a name space alias -#define AL_ELEMENT_ACCELERATORLIST "accel:acceleratorlist" -#define AL_ELEMENT_ITEM "accel:item" +inline constexpr OUStringLiteral AL_ELEMENT_ACCELERATORLIST = u"accel:acceleratorlist"; +inline constexpr OUStringLiteral AL_ELEMENT_ITEM = u"accel:item"; } // namespace framework diff --git a/framework/inc/bitmaps.hlst b/framework/inc/bitmaps.hlst index e65566982d06..78211ef9e8c1 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 OUStringLiteral BMP_SAVEMODIFIED_SMALL = u"res/savemodified_small.png"; +inline constexpr OUStringLiteral BMP_SAVEMODIFIED_LARGE = u"res/savemodified_large.png"; +inline constexpr OUStringLiteral BMP_SAVEMODIFIED_EXTRALARGE = u"res/savemodified_extralarge.png"; + +inline constexpr OUStringLiteral RID_SVXBMP_BUTTON = u"res/sx10594.png"; +inline constexpr OUStringLiteral RID_SVXBMP_RADIOBUTTON = u"res/sx10595.png"; +inline constexpr OUStringLiteral RID_SVXBMP_CHECKBOX = u"res/sx10596.png"; +inline constexpr OUStringLiteral RID_SVXBMP_FIXEDTEXT = u"res/sx10597.png"; +inline constexpr OUStringLiteral RID_SVXBMP_GROUPBOX = u"res/sx10598.png"; +inline constexpr OUStringLiteral RID_SVXBMP_EDITBOX = u"res/sx10599.png"; +inline constexpr OUStringLiteral RID_SVXBMP_LISTBOX = u"res/sx10600.png"; +inline constexpr OUStringLiteral RID_SVXBMP_COMBOBOX = u"res/sx10601.png"; +inline constexpr OUStringLiteral RID_SVXBMP_IMAGEBUTTON = u"res/sx10604.png"; +inline constexpr OUStringLiteral RID_SVXBMP_IMAGECONTROL = u"res/sx10710.png"; +inline constexpr OUStringLiteral RID_SVXBMP_FILECONTROL = u"res/sx10605.png"; +inline constexpr OUStringLiteral RID_SVXBMP_DATEFIELD = u"res/sx10704.png"; +inline constexpr OUStringLiteral RID_SVXBMP_TIMEFIELD = u"res/sx10705.png"; +inline constexpr OUStringLiteral RID_SVXBMP_NUMERICFIELD = u"res/sx10706.png"; +inline constexpr OUStringLiteral RID_SVXBMP_CURRENCYFIELD = u"res/sx10707.png"; +inline constexpr OUStringLiteral RID_SVXBMP_PATTERNFIELD = u"res/sx10708.png"; +inline constexpr OUStringLiteral RID_SVXBMP_FORMATTEDFIELD = u"res/sx10728.png"; +inline constexpr OUStringLiteral RID_SVXBMP_SCROLLBAR = u"res/sx10768.png"; +inline constexpr OUStringLiteral RID_SVXBMP_SPINBUTTON = u"res/sx10769.png"; +inline constexpr OUStringLiteral RID_SVXBMP_NAVIGATIONBAR = u"res/sx10607.png"; /* 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..71d4100d9879 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 OUStringLiteral SERVICENAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.ui.ActionTriggerContainer"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.ActionTriggerContainer"; namespace framework { diff --git a/framework/inc/classes/actiontriggerpropertyset.hxx b/framework/inc/classes/actiontriggerpropertyset.hxx index 59c883cf8841..78d49e7ef279 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 OUStringLiteral SERVICENAME_ACTIONTRIGGER = u"com.sun.star.ui.ActionTrigger"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGER = u"com.sun.star.comp.ui.ActionTrigger"; namespace framework { diff --git a/framework/inc/classes/actiontriggerseparatorpropertyset.hxx b/framework/inc/classes/actiontriggerseparatorpropertyset.hxx index 198fa2f8393c..b68493696e42 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 OUStringLiteral SERVICENAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.ui.ActionTriggerSeparator"; +inline constexpr OUStringLiteral IMPLEMENTATIONNAME_ACTIONTRIGGERSEPARATOR = u"com.sun.star.comp.ui.ActionTriggerSeparator"; namespace framework { diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx index 25e315025dc3..e156f9b0da62 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 OUStringLiteral PACKAGENAME_PROTOCOLHANDLER = u"Office.ProtocolHandler"; /// name of our configuration package #define CFG_PATH_SEPARATOR "/" /// separator for configuration paths diff --git a/framework/inc/classes/rootactiontriggercontainer.hxx b/framework/inc/classes/rootactiontriggercontainer.hxx index 151a7c7338d4..cc4f42d941b2 100644 --- a/framework/inc/classes/rootactiontriggercontainer.hxx +++ b/framework/inc/classes/rootactiontriggercontainer.hxx @@ -27,7 +27,7 @@ #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 OUStringLiteral IMPLEMENTATIONNAME_ROOTACTIONTRIGGERCONTAINER = u"com.sun.star.comp.ui.RootActionTriggerContainer"; namespace framework { diff --git a/framework/inc/properties.h b/framework/inc/properties.h index 06da65ca733c..3af932eeab8d 100644 --- a/framework/inc/properties.h +++ b/framework/inc/properties.h @@ -25,12 +25,12 @@ 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 OUStringLiteral FRAME_PROPNAME_ASCII_DISPATCHRECORDERSUPPLIER = u"DispatchRecorderSupplier"; +inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_ISHIDDEN = u"IsHidden"; +inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_LAYOUTMANAGER = u"LayoutManager"; +inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_TITLE = u"Title"; +inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_INDICATORINTERCEPTION = u"IndicatorInterception"; +inline constexpr OUStringLiteral FRAME_PROPNAME_ASCII_URL = u"URL"; // 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. @@ -74,12 +74,12 @@ namespace framework{ /** 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 OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER = u"MenuBarCloser"; +inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_AUTOMATICTOOLBARS = u"AutomaticToolbars"; +inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_REFRESHVISIBILITY = u"RefreshContextToolbarVisibility"; +inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_HIDECURRENTUI = u"HideCurrentUI"; +inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_LOCKCOUNT = u"LockCount"; +inline constexpr OUStringLiteral LAYOUTMANAGER_PROPNAME_ASCII_PRESERVE_CONTENT_SIZE = u"PreserveContentSize"; #define LAYOUTMANAGER_PROPNAME_MENUBARCLOSER LAYOUTMANAGER_PROPNAME_ASCII_MENUBARCLOSER @@ -91,18 +91,18 @@ namespace framework{ #define LAYOUTMANAGER_PROPHANDLE_PRESERVE_CONTENT_SIZE 5 /** 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 OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDIMAGELIST = u"private:resource/image/commandimagelist"; +inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDROTATEIMAGELIST = u"private:resource/image/commandrotateimagelist"; +inline constexpr OUStringLiteral UICOMMANDDESCRIPTION_NAMEACCESS_COMMANDMIRRORIMAGELIST = u"private:resource/image/commandmirrorimagelist"; #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 OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA = u"ExistsRecoveryData"; +inline constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA = u"ExistsSessionData"; +inline constexpr OUStringLiteral AUTORECOVERY_PROPNAME_ASCII_CRASHED = u"Crashed"; #define AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_RECOVERYDATA #define AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA AUTORECOVERY_PROPNAME_ASCII_EXISTS_SESSIONDATA @@ -116,12 +116,12 @@ namespace framework{ /** properties for Filter config */ -#define FILTER_PROPNAME_ASCII_DOCUMENTSERVICE "DocumentService" +inline constexpr OUStringLiteral FILTER_PROPNAME_ASCII_DOCUMENTSERVICE = u"DocumentService"; /** properties for office module config (Setup.xcu) */ -#define OFFICEFACTORY_PROPNAME_ASCII_UINAME "ooSetupFactoryUIName" -#define OFFICEFACTORY_PROPNAME_ASCII_ICON "ooSetupFactoryIcon" +inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_UINAME = u"ooSetupFactoryUIName"; +inline constexpr OUStringLiteral OFFICEFACTORY_PROPNAME_ASCII_ICON = u"ooSetupFactoryIcon"; /** properties for tab window (old) */ #define TABWINDOW_PROPNAME_ASCII_PARENTWINDOW "ParentWindow" diff --git a/framework/inc/services.h b/framework/inc/services.h index 885ade4fbf47..aa07586b8ba6 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 OUStringLiteral SERVICENAME_FILTERFACTORY = u"com.sun.star.document.FilterFactory"; +inline constexpr OUStringLiteral SERVICENAME_CFGUPDATEACCESS = u"com.sun.star.configuration.ConfigurationUpdateAccess"; // provides read/write access to the configuration +inline constexpr OUStringLiteral SERVICENAME_CFGREADACCESS = u"com.sun.star.configuration.ConfigurationAccess"; // provides readonly access to the configuration +inline constexpr OUStringLiteral SERVICENAME_JOB = u"com.sun.star.task.Job"; +inline constexpr OUStringLiteral SERVICENAME_PROTOCOLHANDLER = u"com.sun.star.frame.ProtocolHandler"; +inline constexpr OUStringLiteral SERVICENAME_POPUPMENUCONTROLLER = u"com.sun.star.frame.PopupMenuController"; // 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 OUStringLiteral IMPLEMENTATIONNAME_FWK_TASKCREATOR = u"com.sun.star.comp.framework.TaskCreator"; } // namespace framework diff --git a/framework/inc/targets.h b/framework/inc/targets.h index 7112e9210644..5627a07cf2a5 100644 --- a/framework/inc/targets.h +++ b/framework/inc/targets.h @@ -23,13 +23,13 @@ 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 OUStringLiteral SPECIALTARGET_SELF = u"_self"; // 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 OUStringLiteral SPECIALTARGET_TOP = u"_top"; // Search at our parents for the first task (if any exist) or a frame without a parent. +inline constexpr OUStringLiteral SPECIALTARGET_BLANK = u"_blank"; // Create a new task. +inline constexpr OUStringLiteral SPECIALTARGET_DEFAULT = u"_default"; // Create a new task or recycle an existing one +inline constexpr OUStringLiteral SPECIALTARGET_BEAMER = u"_beamer"; // special frame in hierarchy +inline constexpr OUStringLiteral SPECIALTARGET_HELPTASK = u"OFFICE_HELP_TASK"; // special name for our help task } // namespace framework diff --git a/framework/inc/taskcreatordefs.hxx b/framework/inc/taskcreatordefs.hxx index 7ca5a02813ce..e07c03d6dd2b 100644 --- a/framework/inc/taskcreatordefs.hxx +++ b/framework/inc/taskcreatordefs.hxx @@ -20,20 +20,20 @@ #pragma once /// [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 OUStringLiteral ARGUMENT_PARENTFRAME = u"ParentFrame"; // 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 OUStringLiteral ARGUMENT_FRAMENAME = u"FrameName"; // 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 +inline constexpr OUStringLiteral ARGUMENT_MAKEVISIBLE = u"MakeVisible"; // sal_Bool /** [sal_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 OUStringLiteral ARGUMENT_CREATETOPWINDOW = u"CreateTopWindow"; // sal_Bool /// [Rectangle] Place the new created frame on this place and resize the container window. inline constexpr OUStringLiteral ARGUMENT_POSSIZE = u"PosSize"; // Rectangle @@ -44,7 +44,7 @@ inline constexpr OUStringLiteral ARGUMENT_CONTAINERWINDOW = u"ContainerWindow"; /** [sal_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 +inline constexpr OUStringLiteral ARGUMENT_SUPPORTPERSISTENTWINDOWSTATE = u"SupportPersistentWindowState"; // sal_Bool /** [sal_Bool] enable/disable special mode, where the title bar of our diff --git a/framework/inc/uiconfiguration/windowstateproperties.hxx b/framework/inc/uiconfiguration/windowstateproperties.hxx index d7a394a80a86..bec99da06e34 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 OUStringLiteral WINDOWSTATE_PROPERTY_LOCKED = u"Locked"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_DOCKED = u"Docked"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_VISIBLE = u"Visible"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_DOCKINGAREA = u"DockingArea"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_DOCKPOS = u"DockPos"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_DOCKSIZE = u"DockSize"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_POS = u"Pos"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_SIZE = u"Size"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_UINAME = u"UIName"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_INTERNALSTATE = u"InternalState"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_STYLE = u"Style"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_CONTEXT = u"ContextSensitive"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_HIDEFROMENU = u"HideFromToolbarMenu"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_NOCLOSE = u"NoClose"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_SOFTCLOSE = u"SoftClose"; +inline constexpr OUStringLiteral WINDOWSTATE_PROPERTY_CONTEXTACTIVE = u"ContextActive"; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/xml/toolboxconfigurationdefines.hxx b/framework/inc/xml/toolboxconfigurationdefines.hxx index b4aca76a6bef..4d2eaffd2a0a 100644 --- a/framework/inc/xml/toolboxconfigurationdefines.hxx +++ b/framework/inc/xml/toolboxconfigurationdefines.hxx @@ -20,7 +20,7 @@ #define XMLNS_TOOLBAR "http://openoffice.org/2001/toolbar" #define XMLNS_XLINK "http://www.w3.org/1999/xlink" -#define XMLNS_TOOLBAR_PREFIX "toolbar:" +inline constexpr OUStringLiteral XMLNS_TOOLBAR_PREFIX = u"toolbar:"; #define XMLNS_XLINK_PREFIX "xlink:" #define XMLNS_FILTER_SEPARATOR "^" @@ -38,28 +38,28 @@ #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" +inline constexpr OUStringLiteral ELEMENT_NS_TOOLBAR = u"toolbar:toolbar"; +inline constexpr OUStringLiteral ELEMENT_NS_TOOLBARITEM = u"toolbar:toolbaritem"; +inline constexpr OUStringLiteral ELEMENT_NS_TOOLBARSPACE = u"toolbar:toolbarspace"; +inline constexpr OUStringLiteral ELEMENT_NS_TOOLBARBREAK = u"toolbar:toolbarbreak"; +inline constexpr OUStringLiteral ELEMENT_NS_TOOLBARSEPARATOR = u"toolbar:toolbarseparator"; -#define ATTRIBUTE_XMLNS_TOOLBAR "xmlns:toolbar" -#define ATTRIBUTE_XMLNS_XLINK "xmlns:xlink" +inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_TOOLBAR = u"xmlns:toolbar"; +inline constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; -#define ATTRIBUTE_TYPE_CDATA "CDATA" +inline constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; #define ATTRIBUTE_BOOLEAN_TRUE "true" -#define ATTRIBUTE_BOOLEAN_FALSE "false" +inline constexpr OUStringLiteral ATTRIBUTE_BOOLEAN_FALSE = u"false"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_RADIO = u"radio"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTO = u"auto"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_LEFT = u"left"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTOSIZE = u"autosize"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWN = u"dropdown"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_REPEAT = u"repeat"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_TEXT = u"text"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY = u"dropdownonly"; -constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_IMAGE = u"image"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_RADIO = u"radio"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTO = u"auto"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_LEFT = u"left"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_AUTOSIZE = u"autosize"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWN = u"dropdown"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_REPEAT = u"repeat"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_TEXT = u"text"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_DROPDOWNONLY = u"dropdownonly"; +inline constexpr OUStringLiteral ATTRIBUTE_ITEMSTYLE_IMAGE = u"image"; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/layoutmanager/helpers.hxx b/framework/source/layoutmanager/helpers.hxx index ffa1443eaf4e..e3df8fa6f0e9 100644 --- a/framework/source/layoutmanager/helpers.hxx +++ b/framework/source/layoutmanager/helpers.hxx @@ -30,8 +30,8 @@ #include <vcl/window.hxx> #include <vcl/toolbox.hxx> -#define UIRESOURCE_URL "private:resource" -#define UIRESOURCETYPE_TOOLBAR "toolbar" +inline constexpr OUStringLiteral UIRESOURCE_URL = u"private:resource"; +inline constexpr OUStringLiteral UIRESOURCETYPE_TOOLBAR = u"toolbar"; #define UIRESOURCETYPE_MENUBAR "menubar" namespace framework diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx index 31b08076e953..cc6f72f36a11 100644 --- a/framework/source/uiconfiguration/windowstateconfiguration.cxx +++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx @@ -79,7 +79,7 @@ const sal_Int16 PROPERTY_DOCKPOS = 14; const sal_Int16 PROPERTY_DOCKSIZE = 15; // Order must be the same as WindowStateMask!! -const char* CONFIGURATION_PROPERTIES[] = +rtl::OUStringConstExpr CONFIGURATION_PROPERTIES[] { WINDOWSTATE_PROPERTY_LOCKED, WINDOWSTATE_PROPERTY_DOCKED, @@ -96,8 +96,7 @@ const char* CONFIGURATION_PROPERTIES[] = WINDOWSTATE_PROPERTY_INTERNALSTATE, WINDOWSTATE_PROPERTY_STYLE, WINDOWSTATE_PROPERTY_DOCKPOS, - WINDOWSTATE_PROPERTY_DOCKSIZE, - nullptr + WINDOWSTATE_PROPERTY_DOCKSIZE }; // Configuration access class for WindowState supplier implementation @@ -223,12 +222,8 @@ ConfigurationAccess_WindowState::ConfigurationAccess_WindowState( std::u16string m_bModified( false ) { // Initialize access array with property names. - sal_Int32 n = 0; - while ( CONFIGURATION_PROPERTIES[n] ) - { - m_aPropArray.push_back( OUString::createFromAscii( CONFIGURATION_PROPERTIES[n] )); - ++n; - } + for (const rtl::OUStringConstExpr & s : CONFIGURATION_PROPERTIES ) + m_aPropArray.push_back(s); } ConfigurationAccess_WindowState::~ConfigurationAccess_WindowState() diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx index 6d8e1c5f3b10..a656a9b3846f 100644 --- a/framework/source/uielement/controlmenucontroller.cxx +++ b/framework/source/uielement/controlmenucontroller.cxx @@ -88,28 +88,28 @@ static TranslateId aLabels[] = RID_STR_PROPTITLE_NAVBAR }; -const std::u16string_view aImgIds[] = +const rtl::OUStringConstExpr aImgIds[] { - u"" RID_SVXBMP_EDITBOX, - u"" RID_SVXBMP_BUTTON, - u"" RID_SVXBMP_FIXEDTEXT, - u"" RID_SVXBMP_LISTBOX, - u"" RID_SVXBMP_CHECKBOX, - u"" RID_SVXBMP_RADIOBUTTON, - u"" RID_SVXBMP_GROUPBOX, - u"" RID_SVXBMP_COMBOBOX, - u"" RID_SVXBMP_IMAGEBUTTON, - u"" RID_SVXBMP_FILECONTROL, - u"" RID_SVXBMP_DATEFIELD, - u"" RID_SVXBMP_TIMEFIELD, - u"" RID_SVXBMP_NUMERICFIELD, - u"" RID_SVXBMP_CURRENCYFIELD, - u"" RID_SVXBMP_PATTERNFIELD, - u"" RID_SVXBMP_IMAGECONTROL, - u"" RID_SVXBMP_FORMATTEDFIELD, - u"" RID_SVXBMP_SCROLLBAR, - u"" RID_SVXBMP_SPINBUTTON, - u"" RID_SVXBMP_NAVIGATIONBAR + RID_SVXBMP_EDITBOX, + RID_SVXBMP_BUTTON, + RID_SVXBMP_FIXEDTEXT, + RID_SVXBMP_LISTBOX, + RID_SVXBMP_CHECKBOX, + RID_SVXBMP_RADIOBUTTON, + RID_SVXBMP_GROUPBOX, + RID_SVXBMP_COMBOBOX, + RID_SVXBMP_IMAGEBUTTON, + RID_SVXBMP_FILECONTROL, + RID_SVXBMP_DATEFIELD, + RID_SVXBMP_TIMEFIELD, + RID_SVXBMP_NUMERICFIELD, + RID_SVXBMP_CURRENCYFIELD, + RID_SVXBMP_PATTERNFIELD, + RID_SVXBMP_IMAGECONTROL, + RID_SVXBMP_FORMATTEDFIELD, + RID_SVXBMP_SCROLLBAR, + RID_SVXBMP_SPINBUTTON, + RID_SVXBMP_NAVIGATIONBAR }; using namespace css; diff --git a/framework/source/xml/imagesdocumenthandler.cxx b/framework/source/xml/imagesdocumenthandler.cxx index faa34f93eea1..7fcedae5134d 100644 --- a/framework/source/xml/imagesdocumenthandler.cxx +++ b/framework/source/xml/imagesdocumenthandler.cxx @@ -48,7 +48,7 @@ constexpr OUStringLiteral ELEMENT_NS_ENTRY = u"image:entry"; #define ATTRIBUTE_MASKMODE "maskmode" #define ATTRIBUTE_HIGHCONTRASTURL "highcontrasturl" #define ATTRIBUTE_HIGHCONTRASTMASKURL "highcontrastmaskurl" -#define ATTRIBUTE_TYPE_CDATA "CDATA" +constexpr OUStringLiteral ATTRIBUTE_TYPE_CDATA = u"CDATA"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_IMAGE = u"xmlns:image"; constexpr OUStringLiteral ATTRIBUTE_XMLNS_XLINK = u"xmlns:xlink"; diff --git a/include/framework/addonsoptions.hxx b/include/framework/addonsoptions.hxx index 07684311bbe9..0e97f7a24a86 100644 --- a/include/framework/addonsoptions.hxx +++ b/include/framework/addonsoptions.hxx @@ -33,14 +33,14 @@ namespace osl { class Mutex; } @descr The method GetAddonsMenu() returns a list of property values. Use follow defines to separate values by names. *//*-*************************************************************************************************************/ -#define ADDONSMENUITEM_STRING_URL "URL" -#define ADDONSMENUITEM_STRING_TITLE "Title" -#define ADDONSMENUITEM_STRING_TARGET "Target" -#define ADDONSMENUITEM_STRING_IMAGEIDENTIFIER "ImageIdentifier" -#define ADDONSMENUITEM_STRING_CONTEXT "Context" -#define ADDONSMENUITEM_STRING_SUBMENU "Submenu" - -#define ADDONSPOPUPMENU_URL_PREFIX_STR "private:menu/Addon" +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_URL = u"URL"; +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_TITLE = u"Title"; +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_TARGET = u"Target"; +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_IMAGEIDENTIFIER = u"ImageIdentifier"; +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_CONTEXT = u"Context"; +inline constexpr OUStringLiteral ADDONSMENUITEM_STRING_SUBMENU = u"Submenu"; + +inline constexpr OUStringLiteral ADDONSPOPUPMENU_URL_PREFIX_STR = u"private:menu/Addon"; namespace framework {