diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 08:13:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-12 16:53:30 +0100 |
commit | f34ac579fac16fff37bf00fe85d43ad6b938eca7 (patch) | |
tree | 0747c4d86bbf40a5093fb7a3215dd52a8e8586b2 /framework/inc | |
parent | c45753847dfc2b4645dc2f7500a18ec2c5d438df (diff) |
New loplugin:stringviewparam
...to "Find functions that take rtl::O[U]String parameters that can be
generalized to take std::[u16]string_view instead." (Which in turn can avoid
costly O[U]String constructions, see e.g. loplugin:stringview and subView.)
Some of those functions' call sites, passing plain char string literals, needed
to be adapted when converting them.
Change-Id: I644ab546d7a0ce9e470ab9b3196e3e60d1e812bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105622
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework/inc')
-rw-r--r-- | framework/inc/uielement/menubarmerger.hxx | 7 | ||||
-rw-r--r-- | framework/inc/uielement/statusbarmerger.hxx | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/framework/inc/uielement/menubarmerger.hxx b/framework/inc/uielement/menubarmerger.hxx index 139c40efc818..8646563b86d8 100644 --- a/framework/inc/uielement/menubarmerger.hxx +++ b/framework/inc/uielement/menubarmerger.hxx @@ -24,6 +24,8 @@ #include <rtl/ustring.hxx> #include <vcl/menu.hxx> + +#include <string_view> #include <vector> namespace framework @@ -58,7 +60,8 @@ struct ReferencePathInfo namespace MenuBarMerger { - bool IsCorrectContext( const OUString& aContext, const OUString& aModuleIdentifier ); + bool IsCorrectContext( + const OUString& aContext, std::u16string_view aModuleIdentifier ); void RetrieveReferencePath( const OUString&, std::vector< OUString >& aReferencePath ); @@ -81,7 +84,7 @@ namespace MenuBarMerger const OUString& rMergeCommand, const OUString& rMergeFallback, const ::std::vector< OUString >& rReferencePath, - const OUString& rModuleIdentifier, + std::u16string_view rModuleIdentifier, const AddonMenuContainer& rAddonMenuItems ); bool MergeMenuItems( Menu* pMenu, sal_uInt16 nPos, diff --git a/framework/inc/uielement/statusbarmerger.hxx b/framework/inc/uielement/statusbarmerger.hxx index 73aa7fd472f0..497862fae127 100644 --- a/framework/inc/uielement/statusbarmerger.hxx +++ b/framework/inc/uielement/statusbarmerger.hxx @@ -19,6 +19,10 @@ #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSBARMERGER_HXX #define INCLUDED_FRAMEWORK_INC_UIELEMENT_STATUSBARMERGER_HXX +#include <sal/config.h> + +#include <string_view> + #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <rtl/ustring.hxx> @@ -45,7 +49,7 @@ typedef ::std::vector< AddonStatusbarItem > AddonStatusbarItemContainer; namespace StatusbarMerger { - bool IsCorrectContext( const OUString& aContext ); + bool IsCorrectContext( std::u16string_view aContext ); bool ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence, AddonStatusbarItemContainer& rContainer ); |