summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /framework
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/helper/persistentwindowstate.hxx4
-rw-r--r--framework/inc/jobs/helponstartup.hxx10
-rw-r--r--framework/inc/jobs/jobdata.hxx3
-rw-r--r--framework/inc/uifactory/configurationaccessfactorymanager.hxx7
-rw-r--r--framework/inc/uifactory/factoryconfiguration.hxx10
-rw-r--r--framework/source/accelerators/acceleratorconfiguration.cxx10
-rw-r--r--framework/source/accelerators/presethandler.cxx16
-rw-r--r--framework/source/fwe/classes/addonsoptions.cxx68
-rw-r--r--framework/source/helper/persistentwindowstate.cxx8
-rw-r--r--framework/source/inc/accelerators/presethandler.hxx12
-rw-r--r--framework/source/jobs/helponstartup.cxx8
-rw-r--r--framework/source/jobs/jobdata.cxx4
-rw-r--r--framework/source/services/pathsettings.cxx15
-rw-r--r--framework/source/uiconfiguration/ImageList.cxx4
-rw-r--r--framework/source/uiconfiguration/ImageList.hxx4
-rw-r--r--framework/source/uiconfiguration/uicategorydescription.cxx8
-rw-r--r--framework/source/uiconfiguration/windowstateconfiguration.cxx8
-rw-r--r--framework/source/uielement/uicommanddescription.cxx16
-rw-r--r--framework/source/uifactory/factoryconfiguration.cxx31
-rw-r--r--framework/source/uifactory/uicontrollerfactory.cxx19
-rw-r--r--framework/source/uifactory/uielementfactorymanager.cxx19
21 files changed, 164 insertions, 120 deletions
diff --git a/framework/inc/helper/persistentwindowstate.hxx b/framework/inc/helper/persistentwindowstate.hxx
index 6b811b9ec3d9..86e477fd7920 100644
--- a/framework/inc/helper/persistentwindowstate.hxx
+++ b/framework/inc/helper/persistentwindowstate.hxx
@@ -117,7 +117,7 @@ class PersistentWindowState final : public ::cppu::WeakImplHelper<
contains the information about position and size.
*/
static OUString implst_getWindowStateFromConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
- const OUString& sModuleName);
+ std::u16string_view sModuleName);
/** @short retrieve the window state from the container window.
@@ -144,7 +144,7 @@ class PersistentWindowState final : public ::cppu::WeakImplHelper<
contains the information about position and size.
*/
static void implst_setWindowStateOnConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const OUString& sModuleName ,
+ std::u16string_view sModuleName ,
const OUString& sWindowState );
/** @short restore the position and size on the container window.
diff --git a/framework/inc/jobs/helponstartup.hxx b/framework/inc/jobs/helponstartup.hxx
index d22e8b98071f..4f3f5c51b5ed 100644
--- a/framework/inc/jobs/helponstartup.hxx
+++ b/framework/inc/jobs/helponstartup.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
#define INCLUDED_FRAMEWORK_INC_JOBS_HELPONSTARTUP_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/task/XJob.hpp>
@@ -175,9 +179,9 @@ class HelpOnStartup final : public ::cppu::WeakImplHelper< css::lang::XServiceIn
e.g. "vnd.sun.star.help://swriter/?Language=en-US&System=WIN"
or "vnd.sun.star.help://swriter/67351?Language=en-US&System=WIN"
*/
- static OUString ist_createHelpURL(const OUString& sBaseURL,
- const OUString& sLocale ,
- const OUString& sSystem );
+ static OUString ist_createHelpURL(std::u16string_view sBaseURL,
+ std::u16string_view sLocale ,
+ std::u16string_view sSystem );
};
} // namespace framework
diff --git a/framework/inc/jobs/jobdata.hxx b/framework/inc/jobs/jobdata.hxx
index 5d64bcb8ce98..e6cdea7ff13e 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 <vector>
namespace framework{
@@ -190,7 +191,7 @@ class JobData final
void disableJob ( );
static std::vector< OUString > getEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const OUString& sEvent );
+ std::u16string_view sEvent );
static void appendEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
const OUString& sEvent ,
diff --git a/framework/inc/uifactory/configurationaccessfactorymanager.hxx b/framework/inc/uifactory/configurationaccessfactorymanager.hxx
index cf4f151f40dc..7b12048e1223 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 <string_view>
#include <unordered_map>
namespace framework {
@@ -42,9 +43,9 @@ class ConfigurationAccess_FactoryManager final : public ::cppu::WeakImplHelper<
void readConfigurationData();
- OUString getFactorySpecifierFromTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule ) const;
- void addFactorySpecifierToTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule, const OUString& aServiceSpecifier );
- void removeFactorySpecifierFromTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule );
+ OUString getFactorySpecifierFromTypeNameModule( std::u16string_view rType, const OUString& 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;
// container.XContainerListener
diff --git a/framework/inc/uifactory/factoryconfiguration.hxx b/framework/inc/uifactory/factoryconfiguration.hxx
index 9a8112702ec0..1ba2a622c74c 100644
--- a/framework/inc/uifactory/factoryconfiguration.hxx
+++ b/framework/inc/uifactory/factoryconfiguration.hxx
@@ -26,6 +26,8 @@
#include <cppuhelper/implbase.hxx>
#include <rtl/ustring.hxx>
+
+#include <string_view>
#include <unordered_map>
// Namespace
@@ -45,10 +47,10 @@ public:
void readConfigurationData();
void updateConfigurationData();
- OUString getServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const;
- OUString getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const;
- void addServiceToCommandModule( const OUString& rCommandURL, const OUString& rModule, const OUString& rServiceSpecifier );
- void removeServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule );
+ OUString getServiceFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const;
+ OUString getValueFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const;
+ void addServiceToCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule, const OUString& rServiceSpecifier );
+ void removeServiceFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule );
// container.XContainerListener
virtual void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index abb929be4230..eb01a00c5291 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -52,7 +52,7 @@
#include <sal/log.hxx>
#include <rtl/ustrbuf.hxx>
-#define PRESET_DEFAULT "default"
+#define PRESET_DEFAULT u"default"
#define TARGET_CURRENT "current"
namespace framework
@@ -217,7 +217,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload()
css::uno::Reference< css::io::XStream > xStreamNoLang;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ xStream = m_aPresetHandler.openTarget(u"" TARGET_CURRENT,
css::embed::ElementModes::READ);
try
{
@@ -257,7 +257,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store()
css::uno::Reference< css::io::XStream > xStream;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ xStream = m_aPresetHandler.openTarget(u"" TARGET_CURRENT,
css::embed::ElementModes::READWRITE); // open or create!
}
@@ -308,7 +308,7 @@ sal_Bool SAL_CALL XMLBasedAcceleratorConfiguration::isReadOnly()
css::uno::Reference< css::io::XStream > xStream;
{
SolarMutexGuard g;
- xStream = m_aPresetHandler.openTarget(TARGET_CURRENT,
+ xStream = m_aPresetHandler.openTarget(u"" TARGET_CURRENT,
css::embed::ElementModes::READWRITE); // open or create!
}
@@ -343,7 +343,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reset()
{
{
SolarMutexGuard g;
- m_aPresetHandler.copyPresetToTarget(PRESET_DEFAULT, TARGET_CURRENT);
+ m_aPresetHandler.copyPresetToTarget(PRESET_DEFAULT, u"" TARGET_CURRENT);
}
reload();
diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx
index 491f48a35c96..bce2e3861499 100644
--- a/framework/source/accelerators/presethandler.cxx
+++ b/framework/source/accelerators/presethandler.cxx
@@ -449,8 +449,8 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType
}
}
-void PresetHandler::copyPresetToTarget(const OUString& sPreset,
- const OUString& sTarget)
+void PresetHandler::copyPresetToTarget(std::u16string_view sPreset,
+ std::u16string_view sTarget)
{
// don't check our preset list, if element exists
// We try to open it and forward all errors to the user!
@@ -474,8 +474,8 @@ void PresetHandler::copyPresetToTarget(const OUString& sPreset,
return;
}
- OUString sPresetFile = sPreset + ".xml";
- OUString sTargetFile = sTarget + ".xml";
+ OUString sPresetFile = OUString::Concat(sPreset) + ".xml";
+ OUString sTargetFile = OUString::Concat(sTarget) + ".xml";
// remove existing elements before you try to copy the preset to that location ...
// Otherwise w will get an ElementExistException inside copyElementTo()!
@@ -490,7 +490,7 @@ void PresetHandler::copyPresetToTarget(const OUString& sPreset,
commitUserChanges();
}
-css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString& sPreset)
+css::uno::Reference< css::io::XStream > PresetHandler::openPreset(std::u16string_view sPreset)
{
css::uno::Reference< css::embed::XStorage > xFolder;
{
@@ -502,7 +502,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString
if (!xFolder.is())
return css::uno::Reference< css::io::XStream >();
- OUString sFile = sPreset + ".xml";
+ OUString sFile = OUString::Concat(sPreset) + ".xml";
// inform user about errors (use original exceptions!)
css::uno::Reference< css::io::XStream > xStream = xFolder->openStreamElement(sFile, css::embed::ElementModes::READ);
@@ -510,7 +510,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString
}
css::uno::Reference< css::io::XStream > PresetHandler::openTarget(
- const OUString& sTarget, sal_Int32 const nMode)
+ std::u16string_view sTarget, sal_Int32 const nMode)
{
css::uno::Reference< css::embed::XStorage > xFolder;
{
@@ -522,7 +522,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openTarget(
if (!xFolder.is())
return css::uno::Reference< css::io::XStream >();
- OUString const sFile(sTarget + ".xml");
+ OUString const sFile(OUString::Concat(sTarget) + ".xml");
return xFolder->openStreamElement(sFile, nMode);
}
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx
index 8d2aa243f702..a8aed7ab7e4d 100644
--- a/framework/source/fwe/classes/addonsoptions.cxx
+++ b/framework/source/fwe/classes/addonsoptions.cxx
@@ -37,6 +37,7 @@
#include <vcl/svapp.hxx>
#include <algorithm>
+#include <string_view>
#include <unordered_map>
#include <vector>
@@ -289,18 +290,18 @@ class AddonsOptions_Impl : public ConfigItem
void ReadNotebookBarMergeInstructions( NotebookBarMergingInstructions& rNotebookBarMergeMap );
void ReadStatusbarMergeInstructions( MergeStatusbarInstructionContainer& rContainer );
- void ReadMergeMenuData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeMenu );
- bool ReadMergeToolbarData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeToolbarItems );
- bool ReadMergeNotebookBarData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeNotebookBarItems );
- bool ReadMergeStatusbarData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeStatusbar );
- bool ReadMenuItem( const OUString& aMenuItemNodeName, Sequence< PropertyValue >& aMenuItem, bool bIgnoreSubMenu = false );
- bool ReadPopupMenu( const OUString& aPopupMenuNodeName, Sequence< PropertyValue >& aPopupMenu );
+ void ReadMergeMenuData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeMenu );
+ bool ReadMergeToolbarData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeToolbarItems );
+ bool ReadMergeNotebookBarData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeNotebookBarItems );
+ bool ReadMergeStatusbarData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeStatusbar );
+ bool ReadMenuItem( std::u16string_view aMenuItemNodeName, Sequence< PropertyValue >& aMenuItem, bool bIgnoreSubMenu = false );
+ bool ReadPopupMenu( std::u16string_view aPopupMenuNodeName, Sequence< PropertyValue >& aPopupMenu );
void AppendPopupMenu( Sequence< PropertyValue >& aTargetPopupMenu, const Sequence< PropertyValue >& rSourcePopupMenu );
- bool ReadToolBarItem( const OUString& aToolBarItemNodeName, Sequence< PropertyValue >& aToolBarItem );
- bool ReadNotebookBarItem( const OUString& aNotebookBarItemNodeName, Sequence< PropertyValue >& aNotebookBarItem );
+ bool ReadToolBarItem( std::u16string_view aToolBarItemNodeName, Sequence< PropertyValue >& aToolBarItem );
+ bool ReadNotebookBarItem( std::u16string_view aNotebookBarItemNodeName, Sequence< PropertyValue >& aNotebookBarItem );
- bool ReadStatusBarItem( const OUString& aStatusbarItemNodeName, Sequence< PropertyValue >& aStatusbarItem );
- std::unique_ptr<ImageEntry> ReadImageData( const OUString& aImagesNodeName );
+ bool ReadStatusBarItem( std::u16string_view aStatusbarItemNodeName, Sequence< PropertyValue >& aStatusbarItem );
+ std::unique_ptr<ImageEntry> ReadImageData( std::u16string_view aImagesNodeName );
void ReadAndAssociateImages( const OUString& aURL, const OUString& aImageId );
BitmapEx ReadImageFromURL( const OUString& aURL );
bool HasAssociatedImages( const OUString& aURL );
@@ -309,13 +310,16 @@ class AddonsOptions_Impl : public ConfigItem
void ReadSubMenuEntries( const Sequence< OUString >& aSubMenuNodeNames, Sequence< Sequence< PropertyValue > >& rSubMenu );
OUString GeneratePrefixURL();
- Sequence< OUString > GetPropertyNamesMenuItem( const OUString& aPropertyRootNode ) const;
- Sequence< OUString > GetPropertyNamesPopupMenu( const OUString& aPropertyRootNode ) const;
- Sequence< OUString > GetPropertyNamesToolBarItem( const OUString& aPropertyRootNode ) const;
- Sequence< OUString > GetPropertyNamesNotebookBarItem( const OUString& aPropertyRootNode ) const;
+ Sequence< OUString > GetPropertyNamesMenuItem( std::u16string_view aPropertyRootNode )
+ const;
+ Sequence< OUString > GetPropertyNamesPopupMenu( std::u16string_view aPropertyRootNode )
+ const;
+ Sequence< OUString > GetPropertyNamesToolBarItem( std::u16string_view aPropertyRootNode )
+ const;
+ Sequence< OUString > GetPropertyNamesNotebookBarItem( std::u16string_view aPropertyRootNode ) const;
- Sequence< OUString > GetPropertyNamesStatusbarItem( const OUString& aPropertyRootNode ) const;
- Sequence< OUString > GetPropertyNamesImages( const OUString& aPropertyRootNode ) const;
+ Sequence< OUString > GetPropertyNamesStatusbarItem( std::u16string_view aPropertyRootNode ) const;
+ Sequence< OUString > GetPropertyNamesImages( std::u16string_view aPropertyRootNode ) const;
bool CreateImageFromSequence( BitmapEx& rImage, Sequence< sal_Int8 >& rBitmapDataSeq ) const;
DECL_LINK(NotifyEvent, void*, void);
@@ -991,7 +995,7 @@ void AddonsOptions_Impl::ReadMenuMergeInstructions( MergeMenuInstructionContaine
}
}
-void AddonsOptions_Impl::ReadMergeMenuData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeMenu )
+void AddonsOptions_Impl::ReadMergeMenuData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeMenu )
{
OUString aMergeMenuBaseNode( aMergeAddonInstructionBase+m_aPropMergeMenuNames[ OFFSET_MERGEMENU_MENUITEMS ] );
@@ -1073,7 +1077,7 @@ void AddonsOptions_Impl::ReadToolbarMergeInstructions( ToolbarMergingInstruction
}
}
-bool AddonsOptions_Impl::ReadMergeToolbarData( const OUString& aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeToolbarItems )
+bool AddonsOptions_Impl::ReadMergeToolbarData( std::u16string_view aMergeAddonInstructionBase, Sequence< Sequence< PropertyValue > >& rMergeToolbarItems )
{
OUString aMergeToolbarBaseNode = aMergeAddonInstructionBase +
m_aPropMergeToolbarNames[ OFFSET_MERGETOOLBAR_TOOLBARITEMS ];
@@ -1154,7 +1158,7 @@ void AddonsOptions_Impl::ReadNotebookBarMergeInstructions(
}
bool AddonsOptions_Impl::ReadMergeNotebookBarData(
- const OUString& aMergeAddonInstructionBase,
+ std::u16string_view aMergeAddonInstructionBase,
Sequence<Sequence<PropertyValue>>& rMergeNotebookBarItems)
{
OUString aMergeNotebookBarBaseNode = aMergeAddonInstructionBase +
@@ -1225,7 +1229,7 @@ void AddonsOptions_Impl::ReadStatusbarMergeInstructions( MergeStatusbarInstructi
}
bool AddonsOptions_Impl::ReadMergeStatusbarData(
- const OUString& aMergeAddonInstructionBase,
+ std::u16string_view aMergeAddonInstructionBase,
Sequence< Sequence< PropertyValue > >& rMergeStatusbarItems )
{
sal_uInt32 nStatusbarItemCount = rMergeStatusbarItems.getLength();
@@ -1263,7 +1267,7 @@ bool AddonsOptions_Impl::ReadMergeStatusbarData(
}
bool AddonsOptions_Impl::ReadStatusBarItem(
- const OUString& aStatusarItemNodeName,
+ std::u16string_view aStatusarItemNodeName,
Sequence< PropertyValue >& aStatusbarItem )
{
bool bResult( false );
@@ -1294,7 +1298,7 @@ bool AddonsOptions_Impl::ReadStatusBarItem(
return bResult;
}
-bool AddonsOptions_Impl::ReadMenuItem( const OUString& aMenuNodeName, Sequence< PropertyValue >& aMenuItem, bool bIgnoreSubMenu )
+bool AddonsOptions_Impl::ReadMenuItem( std::u16string_view aMenuNodeName, Sequence< PropertyValue >& aMenuItem, bool bIgnoreSubMenu )
{
bool bResult = false;
OUString aStrValue;
@@ -1364,7 +1368,7 @@ bool AddonsOptions_Impl::ReadMenuItem( const OUString& aMenuNodeName, Sequence<
return bResult;
}
-bool AddonsOptions_Impl::ReadPopupMenu( const OUString& aPopupMenuNodeName, Sequence< PropertyValue >& aPopupMenu )
+bool AddonsOptions_Impl::ReadPopupMenu( std::u16string_view aPopupMenuNodeName, Sequence< PropertyValue >& aPopupMenu )
{
bool bResult = false;
OUString aStrValue;
@@ -1417,7 +1421,7 @@ void AddonsOptions_Impl::AppendPopupMenu( Sequence< PropertyValue >& rTargetPopu
}
}
-bool AddonsOptions_Impl::ReadToolBarItem( const OUString& aToolBarItemNodeName, Sequence< PropertyValue >& aToolBarItem )
+bool AddonsOptions_Impl::ReadToolBarItem( std::u16string_view aToolBarItemNodeName, Sequence< PropertyValue >& aToolBarItem )
{
bool bResult = false;
OUString aURL;
@@ -1470,7 +1474,7 @@ bool AddonsOptions_Impl::ReadToolBarItem( const OUString& aToolBarItemNodeName,
return bResult;
}
-bool AddonsOptions_Impl::ReadNotebookBarItem( const OUString& aNotebookBarItemNodeName, Sequence< PropertyValue >& aNotebookBarItem )
+bool AddonsOptions_Impl::ReadNotebookBarItem( std::u16string_view aNotebookBarItemNodeName, Sequence< PropertyValue >& aNotebookBarItem )
{
bool bResult = false;
OUString aURL;
@@ -1616,7 +1620,7 @@ void AddonsOptions_Impl::ReadAndAssociateImages( const OUString& aURL, const OUS
m_aImageManager.emplace( aURL, aImageEntry );
}
-std::unique_ptr<AddonsOptions_Impl::ImageEntry> AddonsOptions_Impl::ReadImageData( const OUString& aImagesNodeName )
+std::unique_ptr<AddonsOptions_Impl::ImageEntry> AddonsOptions_Impl::ReadImageData( std::u16string_view aImagesNodeName )
{
Sequence< OUString > aImageDataNodeNames = GetPropertyNamesImages( aImagesNodeName );
Sequence< Any > aPropertyData;
@@ -1683,7 +1687,7 @@ bool AddonsOptions_Impl::CreateImageFromSequence( BitmapEx& rImage, Sequence< sa
return bResult;
}
-Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesMenuItem( const OUString& aPropertyRootNode ) const
+Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesMenuItem( std::u16string_view aPropertyRootNode ) const
{
Sequence< OUString > lResult( PROPERTYCOUNT_MENUITEM );
@@ -1698,7 +1702,7 @@ Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesMenuItem( const OUStrin
return lResult;
}
-Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesPopupMenu( const OUString& aPropertyRootNode ) const
+Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesPopupMenu( std::u16string_view aPropertyRootNode ) const
{
// The URL is automatically set and not read from the configuration.
Sequence< OUString > lResult( PROPERTYCOUNT_POPUPMENU-1 );
@@ -1711,7 +1715,7 @@ Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesPopupMenu( const OUStri
return lResult;
}
-Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesToolBarItem( const OUString& aPropertyRootNode ) const
+Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesToolBarItem( std::u16string_view aPropertyRootNode ) const
{
Sequence< OUString > lResult( PROPERTYCOUNT_TOOLBARITEM );
@@ -1727,7 +1731,7 @@ Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesToolBarItem( const OUSt
return lResult;
}
-Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesNotebookBarItem( const OUString& aPropertyRootNode ) const
+Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesNotebookBarItem( std::u16string_view aPropertyRootNode ) const
{
Sequence< OUString > lResult( PROPERTYCOUNT_NOTEBOOKBARITEM );
@@ -1745,7 +1749,7 @@ Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesNotebookBarItem( const
}
Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesStatusbarItem(
- const OUString& aPropertyRootNode ) const
+ std::u16string_view aPropertyRootNode ) const
{
Sequence< OUString > lResult( PROPERTYCOUNT_STATUSBARITEM );
@@ -1761,7 +1765,7 @@ Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesStatusbarItem(
return lResult;
}
-Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesImages( const OUString& aPropertyRootNode ) const
+Sequence< OUString > AddonsOptions_Impl::GetPropertyNamesImages( std::u16string_view aPropertyRootNode ) const
{
Sequence< OUString > lResult( PROPERTYCOUNT_IMAGES );
diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx
index 5d4212e1ac2a..d2e78df8d98c 100644
--- a/framework/source/helper/persistentwindowstate.cxx
+++ b/framework/source/helper/persistentwindowstate.cxx
@@ -159,14 +159,14 @@ OUString PersistentWindowState::implst_identifyModule(const css::uno::Reference<
OUString PersistentWindowState::implst_getWindowStateFromConfig(
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const OUString& sModuleName)
+ std::u16string_view sModuleName)
{
OUString sWindowState;
try
{
::comphelper::ConfigurationHelper::readDirectKey(rxContext,
"org.openoffice.Setup/",
- "Office/Factories/*[\"" + sModuleName + "\"]",
+ OUString::Concat("Office/Factories/*[\"") + sModuleName + "\"]",
"ooSetupFactoryWindowAttributes",
::comphelper::EConfigurationModes::ReadOnly) >>= sWindowState;
}
@@ -180,13 +180,13 @@ OUString PersistentWindowState::implst_getWindowStateFromConfig(
void PersistentWindowState::implst_setWindowStateOnConfig(
const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const OUString& sModuleName, const OUString& sWindowState)
+ std::u16string_view sModuleName, const OUString& sWindowState)
{
try
{
::comphelper::ConfigurationHelper::writeDirectKey(rxContext,
"org.openoffice.Setup/",
- "Office/Factories/*[\"" + sModuleName + "\"]",
+ OUString::Concat("Office/Factories/*[\"") + sModuleName + "\"]",
"ooSetupFactoryWindowAttributes",
css::uno::makeAny(sWindowState),
::comphelper::EConfigurationModes::Standard);
diff --git a/framework/source/inc/accelerators/presethandler.hxx b/framework/source/inc/accelerators/presethandler.hxx
index f30278696cfb..ad0a2e1260d5 100644
--- a/framework/source/inc/accelerators/presethandler.hxx
+++ b/framework/source/inc/accelerators/presethandler.hxx
@@ -20,6 +20,10 @@
#ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_PRESETHANDLER_HXX
#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_PRESETHANDLER_HXX
+#include <sal/config.h>
+
+#include <string_view>
+
#include <accelerators/storageholder.hxx>
#include <com/sun/star/embed/XStorage.hpp>
@@ -229,8 +233,8 @@ class PresetHandler
@throw css::io::IOException
if copying failed.
*/
- void copyPresetToTarget(const OUString& sPreset,
- const OUString& sTarget);
+ void copyPresetToTarget(std::u16string_view sPreset,
+ std::u16string_view sTarget);
/** @short open the specified preset as stream object
and return it.
@@ -245,7 +249,7 @@ class PresetHandler
@return The opened preset stream ... or NULL if the preset does not exists.
*/
- css::uno::Reference< css::io::XStream > openPreset(const OUString& sPreset);
+ css::uno::Reference< css::io::XStream > openPreset(std::u16string_view sPreset);
/** @short open the specified target as stream object
and return it.
@@ -262,7 +266,7 @@ class PresetHandler
or couldn't be created as new one.
*/
css::uno::Reference< css::io::XStream > openTarget(
- const OUString& sTarget, sal_Int32 nMode);
+ std::u16string_view sTarget, sal_Int32 nMode);
/** @short do anything which is necessary to flush all changes
back to disk.
diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx
index 43b94cfa8021..f022cbb73e05 100644
--- a/framework/source/jobs/helponstartup.cxx
+++ b/framework/source/jobs/helponstartup.cxx
@@ -316,11 +316,11 @@ OUString HelpOnStartup::its_checkIfHelpEnabledAndGetURL(const OUString& sModule)
return sHelpURL;
}
-OUString HelpOnStartup::ist_createHelpURL(const OUString& sBaseURL,
- const OUString& sLocale ,
- const OUString& sSystem )
+OUString HelpOnStartup::ist_createHelpURL(std::u16string_view sBaseURL,
+ std::u16string_view sLocale ,
+ std::u16string_view sSystem )
{
- return sBaseURL + "?Language=" + sLocale + "&System=" + sSystem;
+ return OUString::Concat(sBaseURL) + "?Language=" + sLocale + "&System=" + sSystem;
}
} // namespace framework
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index e04b18227326..6013812e0e7f 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -478,7 +478,7 @@ bool JobData::hasCorrectContext(const OUString& rModuleIdent) const
}
std::vector< OUString > JobData::getEnabledJobsForEvent( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
- const OUString& sEvent )
+ std::u16string_view sEvent )
{
// create a config access to "/org.openoffice.Office.Jobs/Events"
ConfigAccess aConfig(rxContext, "/org.openoffice.Office.Jobs/Events");
@@ -491,7 +491,7 @@ std::vector< OUString > JobData::getEnabledJobsForEvent( const css::uno::Referen
return std::vector< OUString >();
// check if the given event exist inside list of registered ones
- OUString sPath(sEvent + "/JobList");
+ OUString sPath(OUString::Concat(sEvent) + "/JobList");
if (!xEventRegistry->hasByHierarchicalName(sPath))
return std::vector< OUString >();
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 6f288ce96da4..72c15015f586 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -19,6 +19,7 @@
#include <sal/config.h>
+#include <string_view>
#include <utility>
#include <unordered_map>
@@ -402,9 +403,9 @@ private:
void impl_storePath(const PathSettings::PathInfo& aPath);
- css::uno::Sequence< sal_Int32 > impl_mapPathName2IDList(const OUString& sPath);
+ css::uno::Sequence< sal_Int32 > impl_mapPathName2IDList(std::u16string_view sPath);
- void impl_notifyPropListener( const OUString& sPath ,
+ void impl_notifyPropListener( std::u16string_view sPath ,
const PathSettings::PathInfo* pPathOld,
const PathSettings::PathInfo* pPathNew);
@@ -793,11 +794,11 @@ PathSettings::EChangeOp PathSettings::impl_updatePath(const OUString& sPath
return eOp;
}
-css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUString& sPath)
+css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(std::u16string_view sPath)
{
- OUString sInternalProp = sPath+POSTFIX_INTERNAL_PATHS;
- OUString sUserProp = sPath+POSTFIX_USER_PATHS;
- OUString sWriteProp = sPath+POSTFIX_WRITE_PATH;
+ OUString sInternalProp = OUString::Concat(sPath)+POSTFIX_INTERNAL_PATHS;
+ OUString sUserProp = OUString::Concat(sPath)+POSTFIX_USER_PATHS;
+ OUString sWriteProp = OUString::Concat(sPath)+POSTFIX_WRITE_PATH;
// Attention: The default set of IDs is fix and must follow these schema.
// Otherwise the outside code ant work for new added properties.
@@ -835,7 +836,7 @@ css::uno::Sequence< sal_Int32 > PathSettings::impl_mapPathName2IDList(const OUSt
return lIDs;
}
-void PathSettings::impl_notifyPropListener( const OUString& sPath,
+void PathSettings::impl_notifyPropListener( std::u16string_view sPath,
const PathSettings::PathInfo* pPathOld,
const PathSettings::PathInfo* pPathNew)
{
diff --git a/framework/source/uiconfiguration/ImageList.cxx b/framework/source/uiconfiguration/ImageList.cxx
index 8aef25517fb4..e047e6a340c7 100644
--- a/framework/source/uiconfiguration/ImageList.cxx
+++ b/framework/source/uiconfiguration/ImageList.cxx
@@ -177,12 +177,12 @@ void ImageList::GetImageNames( std::vector< OUString >& rNames ) const
}
}
-void ImageList::ImplAddImage( const OUString &aPrefix, const OUString &aName,
+void ImageList::ImplAddImage( std::u16string_view aPrefix, const OUString &aName,
sal_uInt16 nId, const Image &aImage )
{
Image aInsert = aImage;
if (!aInsert)
- aInsert = Image( "private:graphicrepository/" + aPrefix + aName );
+ aInsert = Image( OUString::Concat("private:graphicrepository/") + aPrefix + aName );
ImageAryData *pImg = new ImageAryData{ aName, nId, aInsert };
maImages.emplace_back( pImg );
diff --git a/framework/source/uiconfiguration/ImageList.hxx b/framework/source/uiconfiguration/ImageList.hxx
index b91a9482c07b..668b958a07c4 100644
--- a/framework/source/uiconfiguration/ImageList.hxx
+++ b/framework/source/uiconfiguration/ImageList.hxx
@@ -21,6 +21,8 @@
#define FRAMEWORK_SOURCE_UICONFIGURATION_IMAGELIST_HXX
#include <vcl/image.hxx>
+
+#include <string_view>
#include <unordered_map>
#include <vector>
@@ -67,7 +69,7 @@ private:
OUString maPrefix;
sal_uInt16 ImplGetImageId( const OUString& rImageName ) const;
- void ImplAddImage( const OUString &aPrefix, const OUString &aName, sal_uInt16 nId, const Image &aImage );
+ void ImplAddImage( std::u16string_view aPrefix, const OUString &aName, sal_uInt16 nId, const Image &aImage );
void ImplRemoveImage( sal_uInt16 nPos );
};
diff --git a/framework/source/uiconfiguration/uicategorydescription.cxx b/framework/source/uiconfiguration/uicategorydescription.cxx
index d83382b3361e..279b8b7fd192 100644
--- a/framework/source/uiconfiguration/uicategorydescription.cxx
+++ b/framework/source/uiconfiguration/uicategorydescription.cxx
@@ -33,6 +33,7 @@
#include <comphelper/propertysequence.hxx>
+#include <string_view>
#include <unordered_map>
using namespace com::sun::star::uno;
@@ -48,7 +49,7 @@ class ConfigurationAccess_UICategory : public ::cppu::WeakImplHelper<XNameAccess
{
osl::Mutex aMutex;
public:
- ConfigurationAccess_UICategory( const OUString& aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XComponentContext >& rxContext );
+ ConfigurationAccess_UICategory( std::u16string_view aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XComponentContext >& rxContext );
virtual ~ConfigurationAccess_UICategory() override;
// XNameAccess
@@ -96,9 +97,10 @@ class ConfigurationAccess_UICategory : public ::cppu::WeakImplHelper<XNameAccess
// XInterface, XTypeProvider
-ConfigurationAccess_UICategory::ConfigurationAccess_UICategory( const OUString& aModuleName, const Reference< XNameAccess >& rGenericUICategories, const Reference< XComponentContext >& rxContext ) :
+ConfigurationAccess_UICategory::ConfigurationAccess_UICategory( std::u16string_view aModuleName, const Reference< XNameAccess >& rGenericUICategories, const Reference< XComponentContext >& rxContext ) :
// Create configuration hierarchical access name
- m_aConfigCategoryAccess( "/org.openoffice.Office.UI." + aModuleName + "/Commands/Categories"),
+ m_aConfigCategoryAccess(
+ OUString::Concat("/org.openoffice.Office.UI.") + aModuleName + "/Commands/Categories"),
m_aPropUIName( "Name" ),
m_xGenericUICategories( rGenericUICategories ),
m_xConfigProvider(theDefaultProvider::get( rxContext )),
diff --git a/framework/source/uiconfiguration/windowstateconfiguration.cxx b/framework/source/uiconfiguration/windowstateconfiguration.cxx
index e1efab20592a..2d6d2b95e102 100644
--- a/framework/source/uiconfiguration/windowstateconfiguration.cxx
+++ b/framework/source/uiconfiguration/windowstateconfiguration.cxx
@@ -44,6 +44,7 @@
#include <comphelper/sequence.hxx>
#include <sal/log.hxx>
+#include <string_view>
#include <unordered_map>
#include <vector>
@@ -104,7 +105,7 @@ const char* CONFIGURATION_PROPERTIES[] =
class ConfigurationAccess_WindowState : public ::cppu::WeakImplHelper< XNameContainer, XContainerListener >
{
public:
- ConfigurationAccess_WindowState( const OUString& aWindowStateConfigFile, const Reference< XComponentContext >& rxContext );
+ ConfigurationAccess_WindowState( std::u16string_view aWindowStateConfigFile, const Reference< XComponentContext >& rxContext );
virtual ~ConfigurationAccess_WindowState() override;
// XNameAccess
@@ -213,9 +214,10 @@ class ConfigurationAccess_WindowState : public ::cppu::WeakImplHelper< XNameCon
std::vector< OUString > m_aPropArray;
};
-ConfigurationAccess_WindowState::ConfigurationAccess_WindowState( const OUString& aModuleName, const Reference< XComponentContext >& rxContext ) :
+ConfigurationAccess_WindowState::ConfigurationAccess_WindowState( std::u16string_view aModuleName, const Reference< XComponentContext >& rxContext ) :
// Create configuration hierarchical access name
- m_aConfigWindowAccess( "/org.openoffice.Office.UI." + aModuleName + "/UIElements/States"),
+ m_aConfigWindowAccess(
+ OUString::Concat("/org.openoffice.Office.UI.") + aModuleName + "/UIElements/States"),
m_xConfigProvider(theDefaultProvider::get( rxContext )),
m_bConfigAccessInitialized( false ),
m_bModified( false )
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 23ef0b8654f4..85a2a3e4ccc4 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <uielement/uicommanddescription.hxx>
#include <properties.h>
@@ -68,7 +72,7 @@ class ConfigurationAccess_UICommand : // Order is necessary for right initializa
{
osl::Mutex m_aMutex;
public:
- ConfigurationAccess_UICommand( const OUString& aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XComponentContext >& rxContext );
+ ConfigurationAccess_UICommand( std::u16string_view aModuleName, const Reference< XNameAccess >& xGenericUICommands, const Reference< XComponentContext >& rxContext );
virtual ~ConfigurationAccess_UICommand() override;
// XNameAccess
@@ -153,10 +157,12 @@ class ConfigurationAccess_UICommand : // Order is necessary for right initializa
// XInterface, XTypeProvider
-ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const OUString& aModuleName, const Reference< XNameAccess >& rGenericUICommands, const Reference< XComponentContext>& rxContext ) :
+ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( std::u16string_view aModuleName, const Reference< XNameAccess >& rGenericUICommands, const Reference< XComponentContext>& rxContext ) :
// Create configuration hierarchical access name
- m_aConfigCmdAccess( CONFIGURATION_ROOT_ACCESS + aModuleName + "/UserInterface/Commands"),
- m_aConfigPopupAccess( CONFIGURATION_ROOT_ACCESS + aModuleName + "/UserInterface/Popups"),
+ m_aConfigCmdAccess(
+ OUString::Concat(CONFIGURATION_ROOT_ACCESS) + aModuleName + "/UserInterface/Commands"),
+ m_aConfigPopupAccess(
+ OUString::Concat(CONFIGURATION_ROOT_ACCESS) + aModuleName + "/UserInterface/Popups"),
m_aPropProperties( "Properties" ),
m_xGenericUICommands( rGenericUICommands ),
m_xConfigProvider( theDefaultProvider::get( rxContext ) ),
@@ -559,7 +565,7 @@ void UICommandDescription::ensureGenericUICommandsForLanguage(const LanguageTag&
if (xGenericUICommands == m_xGenericUICommands.end())
{
Reference< XNameAccess > xEmpty;
- m_xGenericUICommands[rLanguage] = new ConfigurationAccess_UICommand( "GenericCommands", xEmpty, m_xContext );
+ m_xGenericUICommands[rLanguage] = new ConfigurationAccess_UICommand( u"GenericCommands", xEmpty, m_xContext );
}
}
diff --git a/framework/source/uifactory/factoryconfiguration.cxx b/framework/source/uifactory/factoryconfiguration.cxx
index 485b5a0a94e7..c0c75db7bba8 100644
--- a/framework/source/uifactory/factoryconfiguration.cxx
+++ b/framework/source/uifactory/factoryconfiguration.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <uifactory/factoryconfiguration.hxx>
#include <services.h>
@@ -41,9 +45,10 @@ using namespace com::sun::star::container;
namespace framework
{
-static OUString getHashKeyFromStrings( const OUString& aCommandURL, const OUString& aModuleName )
+static OUString getHashKeyFromStrings(
+ std::u16string_view aCommandURL, std::u16string_view aModuleName )
{
- return aCommandURL + "-" + aModuleName;
+ return OUString::Concat(aCommandURL) + "-" + aModuleName;
}
// XInterface, XTypeProvider
@@ -68,17 +73,18 @@ ConfigurationAccess_ControllerFactory::~ConfigurationAccess_ControllerFactory()
xContainer->removeContainerListener(m_xConfigAccessListener);
}
-OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const
+OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const
{
osl::MutexGuard g(m_mutex);
MenuControllerMap::const_iterator pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, rModule ));
if ( pIter != m_aMenuControllerMap.end() )
return pIter->second.m_aImplementationName;
- else if ( !rModule.isEmpty() )
+ else if ( !rModule.empty() )
{
// Try to detect if we have a generic popup menu controller
- pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, OUString() ));
+ pIter = m_aMenuControllerMap.find(
+ getHashKeyFromStrings( rCommandURL, std::u16string_view() ));
if ( pIter != m_aMenuControllerMap.end() )
return pIter->second.m_aImplementationName;
@@ -86,7 +92,7 @@ OUString ConfigurationAccess_ControllerFactory::getServiceFromCommandModule( con
return OUString();
}
-OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( const OUString& rCommandURL, const OUString& rModule ) const
+OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( std::u16string_view rCommandURL, std::u16string_view rModule ) const
{
osl::MutexGuard g(m_mutex);
@@ -94,10 +100,11 @@ OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( const
if ( pIter != m_aMenuControllerMap.end() )
return pIter->second.m_aValue;
- else if ( !rModule.isEmpty() )
+ else if ( !rModule.empty() )
{
// Try to detect if we have a generic popup menu controller
- pIter = m_aMenuControllerMap.find( getHashKeyFromStrings( rCommandURL, OUString() ));
+ pIter = m_aMenuControllerMap.find(
+ getHashKeyFromStrings( rCommandURL, std::u16string_view() ));
if ( pIter != m_aMenuControllerMap.end() )
return pIter->second.m_aValue;
@@ -107,8 +114,8 @@ OUString ConfigurationAccess_ControllerFactory::getValueFromCommandModule( const
}
void ConfigurationAccess_ControllerFactory::addServiceToCommandModule(
- const OUString& rCommandURL,
- const OUString& rModule,
+ std::u16string_view rCommandURL,
+ std::u16string_view rModule,
const OUString& rServiceSpecifier )
{
osl::MutexGuard g(m_mutex);
@@ -118,8 +125,8 @@ void ConfigurationAccess_ControllerFactory::addServiceToCommandModule(
}
void ConfigurationAccess_ControllerFactory::removeServiceFromCommandModule(
- const OUString& rCommandURL,
- const OUString& rModule )
+ std::u16string_view rCommandURL,
+ std::u16string_view rModule )
{
osl::MutexGuard g(m_mutex);
diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx
index 73959546a0ce..619b66d7c420 100644
--- a/framework/source/uifactory/uicontrollerfactory.cxx
+++ b/framework/source/uifactory/uicontrollerfactory.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <uifactory/factoryconfiguration.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -58,7 +62,7 @@ public:
virtual void SAL_CALL deregisterController( const OUString& aCommandURL, const OUString& aModuleName ) override;
protected:
- UIControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, const OUString &rUINode );
+ UIControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, std::u16string_view rUINode );
bool m_bConfigRead;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
rtl::Reference<ConfigurationAccess_ControllerFactory> m_pConfigAccess;
@@ -69,14 +73,15 @@ private:
UIControllerFactory::UIControllerFactory(
const Reference< XComponentContext >& xContext,
- const OUString &rConfigurationNode )
+ std::u16string_view rConfigurationNode )
: UIControllerFactory_BASE(m_aMutex)
, m_bConfigRead( false )
, m_xContext( xContext )
, m_pConfigAccess()
{
m_pConfigAccess = new ConfigurationAccess_ControllerFactory(m_xContext,
- "/org.openoffice.Office.UI.Controller/Registered/" + rConfigurationNode);
+ OUString::Concat("/org.openoffice.Office.UI.Controller/Registered/")
+ + rConfigurationNode);
}
UIControllerFactory::~UIControllerFactory()
@@ -104,7 +109,7 @@ Reference< XInterface > SAL_CALL UIControllerFactory::createInstanceWithContext(
m_pConfigAccess->readConfigurationData();
}
- OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, OUString() );
+ OUString aServiceName = m_pConfigAccess->getServiceFromCommandModule( aServiceSpecifier, std::u16string_view() );
if ( !aServiceName.isEmpty() )
return m_xContext->getServiceManager()->createInstanceWithContext( aServiceName, m_xContext );
else
@@ -252,7 +257,7 @@ public:
};
PopupMenuControllerFactory::PopupMenuControllerFactory( const Reference< XComponentContext >& xContext ) :
- UIControllerFactory( xContext, "PopupMenu" )
+ UIControllerFactory( xContext, u"PopupMenu" )
{
}
@@ -297,7 +302,7 @@ public:
};
ToolbarControllerFactory::ToolbarControllerFactory( const Reference< XComponentContext >& xContext ) :
- UIControllerFactory( xContext, "ToolBar" )
+ UIControllerFactory( xContext, u"ToolBar" )
{
}
@@ -342,7 +347,7 @@ public:
};
StatusbarControllerFactory::StatusbarControllerFactory( const Reference< XComponentContext >& xContext ) :
- UIControllerFactory( xContext, "StatusBar" )
+ UIControllerFactory( xContext, u"StatusBar" )
{
}
diff --git a/framework/source/uifactory/uielementfactorymanager.cxx b/framework/source/uifactory/uielementfactorymanager.cxx
index 68e2286836cb..02d5435bab80 100644
--- a/framework/source/uifactory/uielementfactorymanager.cxx
+++ b/framework/source/uifactory/uielementfactorymanager.cxx
@@ -19,6 +19,8 @@
#include <sal/config.h>
+#include <string_view>
+
#include <uifactory/configurationaccessfactorymanager.hxx>
#include <helper/mischelper.hxx>
@@ -56,9 +58,9 @@ namespace framework
{
// global function needed by both implementations
-static OUString getHashKeyFromStrings( const OUString& aType, const OUString& aName, const OUString& aModuleName )
+static OUString getHashKeyFromStrings( std::u16string_view aType, std::u16string_view aName, std::u16string_view aModuleName )
{
- return aType + "^" + aName + "^" + aModuleName;
+ return OUString::Concat(aType) + "^" + aName + "^" + aModuleName;
}
ConfigurationAccess_FactoryManager::ConfigurationAccess_FactoryManager( const Reference< XComponentContext >& rxContext, const OUString& _sRoot ) :
@@ -82,7 +84,7 @@ ConfigurationAccess_FactoryManager::~ConfigurationAccess_FactoryManager()
xContainer->removeContainerListener(m_xConfigListener);
}
-OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule ) const
+OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModule( std::u16string_view rType, const OUString& rName, std::u16string_view rModule ) const
{
// SAFE
osl::MutexGuard g(m_aMutex);
@@ -93,7 +95,8 @@ OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModu
return pIter->second;
else
{
- pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, rName, OUString() ));
+ pIter = m_aFactoryManagerMap.find(
+ getHashKeyFromStrings( rType, rName, std::u16string_view() ));
if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
else
@@ -103,12 +106,12 @@ OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModu
if ( nIndex > 0 )
{
OUString aName = rName.copy( 0, nIndex+1 );
- pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, aName, OUString() ));
+ pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, aName, std::u16string_view() ));
if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
}
- pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, OUString(), OUString() ));
+ pIter = m_aFactoryManagerMap.find( getHashKeyFromStrings( rType, std::u16string_view(), std::u16string_view() ));
if ( pIter != m_aFactoryManagerMap.end() )
return pIter->second;
}
@@ -117,7 +120,7 @@ OUString ConfigurationAccess_FactoryManager::getFactorySpecifierFromTypeNameModu
return OUString();
}
-void ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule, const OUString& rServiceSpecifier )
+void ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule, const OUString& rServiceSpecifier )
{
// SAFE
osl::MutexGuard g(m_aMutex);
@@ -131,7 +134,7 @@ void ConfigurationAccess_FactoryManager::addFactorySpecifierToTypeNameModule( co
m_aFactoryManagerMap.emplace( aHashKey, rServiceSpecifier );
}
-void ConfigurationAccess_FactoryManager::removeFactorySpecifierFromTypeNameModule( const OUString& rType, const OUString& rName, const OUString& rModule )
+void ConfigurationAccess_FactoryManager::removeFactorySpecifierFromTypeNameModule( std::u16string_view rType, std::u16string_view rName, std::u16string_view rModule )
{
// SAFE
osl::MutexGuard g(m_aMutex);