[Libreoffice-commits] core.git: chart2/source comphelper/source compilerplugins/clang framework/inc framework/source i18npool/inc i18npool/source include/comphelper include/sfx2 include/xmloff l10ntools/source sc/source sd/source sfx2/source svx/source sw/inc sw/source ucb/source xmloff/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sun Dec 27 10:27:13 UTC 2020


 chart2/source/inc/ConfigColorScheme.hxx                        |    3 
 chart2/source/tools/ConfigColorScheme.cxx                      |    2 
 comphelper/source/misc/graphicmimetype.cxx                     |    2 
 compilerplugins/clang/stringviewparam.cxx                      |   39 +------
 framework/inc/uielement/menubarmerger.hxx                      |    6 -
 framework/inc/uielement/statusbarmerger.hxx                    |    4 
 framework/inc/uielement/toolbarmerger.hxx                      |   12 +-
 framework/source/accelerators/acceleratorconfiguration.cxx     |    2 
 framework/source/inc/accelerators/acceleratorconfiguration.hxx |    6 +
 framework/source/uielement/menubarmerger.cxx                   |   18 +--
 framework/source/uielement/statusbarmerger.cxx                 |   12 +-
 framework/source/uielement/toolbarmerger.cxx                   |   50 +++++-----
 i18npool/inc/indexentrysupplier_default.hxx                    |    3 
 i18npool/inc/localedata.hxx                                    |   12 +-
 i18npool/source/indexentry/indexentrysupplier_default.cxx      |    2 
 i18npool/source/localedata/localedata.cxx                      |   10 +-
 include/comphelper/graphicmimetype.hxx                         |    6 +
 include/sfx2/XmlIdRegistry.hxx                                 |    2 
 include/sfx2/mailmodelapi.hxx                                  |    3 
 include/xmloff/SettingsExportHelper.hxx                        |    6 +
 l10ntools/source/localize.cxx                                  |    2 
 sc/source/ui/docshell/docsh.cxx                                |   10 +-
 sc/source/ui/inc/docsh.hxx                                     |    3 
 sd/source/ui/dlg/LayerTabBar.cxx                               |    2 
 sd/source/ui/inc/LayerTabBar.hxx                               |    6 +
 sd/source/ui/view/ToolBarManager.cxx                           |    5 -
 sfx2/source/dialog/mailmodel.cxx                               |    4 
 sfx2/source/doc/DocumentMetadataAccess.cxx                     |   25 ++---
 sfx2/source/doc/Metadatable.cxx                                |   50 +++++-----
 svx/source/form/fmshimp.cxx                                    |    8 -
 svx/source/inc/datanavi.hxx                                    |    5 -
 svx/source/inc/fmshimp.hxx                                     |    9 +
 sw/inc/unosett.hxx                                             |    6 +
 sw/source/core/unocore/unosett.cxx                             |    4 
 sw/source/filter/html/css1atr.cxx                              |    2 
 sw/source/filter/html/wrthtml.hxx                              |    2 
 ucb/source/cacher/cachedcontentresultset.cxx                   |    9 +
 xmloff/source/core/SettingsExportHelper.cxx                    |    2 
 38 files changed, 183 insertions(+), 171 deletions(-)

New commits:
commit 9013dc1650aa8400f63da5f584df9058b1740eb3
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Dec 22 14:08:08 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sun Dec 27 11:26:32 2020 +0100

    Simplify loplugin:stringviewparam comparison operator handling
    
    In practice, it works fine to look at all of them, regardless of actual argument
    types.
    
    Change-Id: Ifc49cbcd6003c8837c1b3f81d432c59fb0657bf1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108366
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/chart2/source/inc/ConfigColorScheme.hxx b/chart2/source/inc/ConfigColorScheme.hxx
index 5eb117781b16..438d5f6ad4d9 100644
--- a/chart2/source/inc/ConfigColorScheme.hxx
+++ b/chart2/source/inc/ConfigColorScheme.hxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/lang/XServiceInfo.hpp>
 
 #include <memory>
+#include <string_view>
 
 namespace com::sun::star::uno { class XComponentContext; }
 
@@ -53,7 +54,7 @@ public:
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
 
     // ____ ConfigItemListener ____
-    void notify( const OUString & rPropertyName );
+    void notify( std::u16string_view rPropertyName );
 
 protected:
     // ____ XColorScheme ____
diff --git a/chart2/source/tools/ConfigColorScheme.cxx b/chart2/source/tools/ConfigColorScheme.cxx
index 2aaf672800ac..466e26ae88b3 100644
--- a/chart2/source/tools/ConfigColorScheme.cxx
+++ b/chart2/source/tools/ConfigColorScheme.cxx
@@ -157,7 +157,7 @@ void ConfigColorScheme::retrieveConfigColors()
     return nDefaultColors[ nIndex % nMaxDefaultColors ];
 }
 
-void ConfigColorScheme::notify( const OUString & rPropertyName )
+void ConfigColorScheme::notify( std::u16string_view rPropertyName )
 {
     if( rPropertyName == aSeriesPropName )
         m_bNeedsUpdate = true;
diff --git a/comphelper/source/misc/graphicmimetype.cxx b/comphelper/source/misc/graphicmimetype.cxx
index 0aea5afdde98..acee8ff80de7 100644
--- a/comphelper/source/misc/graphicmimetype.cxx
+++ b/comphelper/source/misc/graphicmimetype.cxx
@@ -36,7 +36,7 @@ using namespace css::uno;
 
 namespace comphelper
 {
-OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(const OString& rExt)
+OUString GraphicMimeTypeHelper::GetMimeTypeForExtension(std::string_view rExt)
 {
     struct XMLGraphicMimeTypeMapper
     {
diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx
index 1e802068da9c..2ef18f75cf60 100644
--- a/compilerplugins/clang/stringviewparam.cxx
+++ b/compilerplugins/clang/stringviewparam.cxx
@@ -181,43 +181,18 @@ SmallVector<DeclRefExpr const*, 2> relevantCXXOperatorCallExpr(CXXOperatorCallEx
         }
         return wrap(relevantDeclRefExpr(e));
     }
-    else if (compat::isComparisonOp(expr))
+    if (compat::isComparisonOp(expr))
     {
-        auto arg0 = compat::IgnoreImplicit(expr->getArg(0));
-        if (isa<clang::StringLiteral>(arg0))
+        SmallVector<DeclRefExpr const*, 2> v;
+        if (auto const e = relevantDeclRefExpr(expr->getArg(0)))
         {
-            return wrap(relevantDeclRefExpr(expr->getArg(1)));
+            v.push_back(e);
         }
-        auto arg1 = compat::IgnoreImplicit(expr->getArg(1));
-        if (isa<clang::StringLiteral>(arg1))
+        if (auto const e = relevantDeclRefExpr(expr->getArg(1)))
         {
-            return wrap(relevantDeclRefExpr(arg0));
-        }
-
-        auto st1 = relevantStringType(arg0->getType());
-        auto st2 = relevantStringType(arg1->getType());
-        if ((st1 == StringType::RtlOstring && st2 == StringType::RtlOstring)
-            || (st1 == StringType::RtlOustring && st2 == StringType::RtlOustring))
-        {
-            SmallVector<DeclRefExpr const*, 2> v;
-            if (auto const e = relevantDeclRefExpr(arg0))
-            {
-                v.push_back(e);
-            }
-            if (auto const e = relevantDeclRefExpr(arg1))
-            {
-                v.push_back(e);
-            }
-            return v;
-        }
-        if (st1 != StringType::None && isStringView(arg1->getType()))
-        {
-            return wrap(relevantDeclRefExpr(arg0));
-        }
-        if (st2 != StringType::None && isStringView(arg0->getType()))
-        {
-            return wrap(relevantDeclRefExpr(arg1));
+            v.push_back(e);
         }
+        return v;
     }
     return {};
 }
diff --git a/framework/inc/uielement/menubarmerger.hxx b/framework/inc/uielement/menubarmerger.hxx
index 910bc58f2014..8de837c5e81e 100644
--- a/framework/inc/uielement/menubarmerger.hxx
+++ b/framework/inc/uielement/menubarmerger.hxx
@@ -75,14 +75,14 @@ namespace MenuBarMerger
         bool       ProcessMergeOperation( Menu*                     pMenu,
                                                  sal_uInt16                nPos,
                                                  sal_uInt16&               rItemId,
-                                                 const OUString&    rMergeCommand,
+                                                 std::u16string_view rMergeCommand,
                                                  const OUString&    rMergeCommandParameter,
                                                  const OUString&    rModuleIdentifier,
                                                  const AddonMenuContainer& rAddonMenuItems );
         bool       ProcessFallbackOperation( const ReferencePathInfo&                aRefPathInfo,
                                                     sal_uInt16&                             rItemId,
-                                                    const OUString&                  rMergeCommand,
-                                                    const OUString&                  rMergeFallback,
+                                                    std::u16string_view              rMergeCommand,
+                                                    std::u16string_view              rMergeFallback,
                                                     const ::std::vector< OUString >& rReferencePath,
                                                     std::u16string_view              rModuleIdentifier,
                                                     const AddonMenuContainer&               rAddonMenuItems );
diff --git a/framework/inc/uielement/statusbarmerger.hxx b/framework/inc/uielement/statusbarmerger.hxx
index d7fecfaa881e..ae7543be4360 100644
--- a/framework/inc/uielement/statusbarmerger.hxx
+++ b/framework/inc/uielement/statusbarmerger.hxx
@@ -60,13 +60,13 @@ namespace StatusbarMerger
     bool ProcessMergeOperation( StatusBar* pStatusbar,
                                        sal_uInt16 nPos,
                                        sal_uInt16& rItemId,
-                                       const OUString& rMergeCommand,
+                                       std::u16string_view rMergeCommand,
                                        const OUString& rMergeCommandParameter,
                                        const AddonStatusbarItemContainer& rItems );
 
     bool ProcessMergeFallback( StatusBar* pStatusbar,
                                       sal_uInt16& rItemId,
-                                      const OUString& rMergeCommand,
+                                      std::u16string_view rMergeCommand,
                                       std::u16string_view rMergeFallback,
                                       const AddonStatusbarItemContainer& rItems );
 }
diff --git a/framework/inc/uielement/toolbarmerger.hxx b/framework/inc/uielement/toolbarmerger.hxx
index 482b730aa749..b62e3be6972c 100644
--- a/framework/inc/uielement/toolbarmerger.hxx
+++ b/framework/inc/uielement/toolbarmerger.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <uielement/commandinfo.hxx>
 
 #include <com/sun/star/beans/PropertyValue.hpp>
@@ -80,7 +84,7 @@ class ToolBarMerger
                                                  sal_uInt16&               rItemId,
                                                  CommandToInfoMap&         rCommandMap,
                                                  std::u16string_view       rModuleIdentifier,
-                                                 const OUString&           rMergeCommand,
+                                                 std::u16string_view       rMergeCommand,
                                                  const OUString&           rMergeCommandParameter,
                                                  const AddonToolbarItemContainer& rItems );
 
@@ -88,8 +92,8 @@ class ToolBarMerger
                                                 sal_uInt16&                      rItemId,
                                                 CommandToInfoMap&                rCommandMap,
                                                 std::u16string_view       rModuleIdentifier,
-                                                const OUString&           rMergeCommand,
-                                                const OUString&           rMergeFallback,
+                                                std::u16string_view       rMergeCommand,
+                                                std::u16string_view       rMergeFallback,
                                                 const AddonToolbarItemContainer& rItems );
 
         static void       MergeItems( ToolBox*                  pToolbar,
@@ -118,7 +122,7 @@ class ToolBarMerger
             const OUString& rCommandURL,
             sal_uInt16      nId,
             sal_uInt16      nWidth,
-            const OUString& rControlType );
+            std::u16string_view rControlType );
 
         static void CreateToolbarItem( ToolBox* pToolbox,
                                        ToolBox::ImplToolItems::size_type nPos,
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index e813213a92a0..abb929be4230 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -1206,7 +1206,7 @@ void XCUBasedAcceleratorConfiguration::removeKeyFromConfiguration( const css::aw
     xContainer->removeByName(sKey);
 }
 
-void XCUBasedAcceleratorConfiguration::reloadChanged( const OUString& sPrimarySecondary, const OUString& sGlobalModules, const OUString& sModule, const OUString& sKey )
+void XCUBasedAcceleratorConfiguration::reloadChanged( const OUString& sPrimarySecondary, std::u16string_view sGlobalModules, const OUString& sModule, const OUString& sKey )
 {
     css::uno::Reference< css::container::XNameAccess > xAccess;
     css::uno::Reference< css::container::XNameContainer > xContainer;
diff --git a/framework/source/inc/accelerators/acceleratorconfiguration.hxx b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
index 6f9daa38b14b..38d9eaff9e98 100644
--- a/framework/source/inc/accelerators/acceleratorconfiguration.hxx
+++ b/framework/source/inc/accelerators/acceleratorconfiguration.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX
 #define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_ACCELERATORCONFIGURATION_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <accelerators/presethandler.hxx>
 #include <accelerators/acceleratorcache.hxx>
 
@@ -299,7 +303,7 @@ class XCUBasedAcceleratorConfiguration : public  ::cppu::WeakImplHelper<
         void insertKeyToConfiguration(const css::awt::KeyEvent& aKeyEvent, const OUString& sCommand, const bool bPreferred);
         void removeKeyFromConfiguration(const css::awt::KeyEvent& aKeyEvent, const bool bPreferred);
 
-        void reloadChanged(const OUString& sPrimarySecondary, const OUString& sGlobalModules, const OUString& sModule, const OUString& sKey);
+        void reloadChanged(const OUString& sPrimarySecondary, std::u16string_view sGlobalModules, const OUString& sModule, const OUString& sKey);
         AcceleratorCache& impl_getCFG(bool bPreferred, bool bWriteAccessRequested = false);
 
 };
diff --git a/framework/source/uielement/menubarmerger.cxx b/framework/source/uielement/menubarmerger.cxx
index 1d59a7e152a6..b353fc954d56 100644
--- a/framework/source/uielement/menubarmerger.cxx
+++ b/framework/source/uielement/menubarmerger.cxx
@@ -25,13 +25,13 @@ using namespace ::com::sun::star;
 
 const char SEPARATOR_STRING[]               = "private:separator";
 
-const char MERGECOMMAND_ADDAFTER[]          = "AddAfter";
-const char MERGECOMMAND_ADDBEFORE[]         = "AddBefore";
-const char MERGECOMMAND_REPLACE[]           = "Replace";
-const char MERGECOMMAND_REMOVE[]            = "Remove";
+const char16_t MERGECOMMAND_ADDAFTER[]      = u"AddAfter";
+const char16_t MERGECOMMAND_ADDBEFORE[]     = u"AddBefore";
+const char16_t MERGECOMMAND_REPLACE[]       = u"Replace";
+const char16_t MERGECOMMAND_REMOVE[]        = u"Remove";
 
-const char MERGEFALLBACK_ADDPATH[]           = "AddPath";
-const char MERGEFALLBACK_IGNORE[]            = "Ignore";
+const char16_t MERGEFALLBACK_ADDPATH[]       = u"AddPath";
+const char16_t MERGEFALLBACK_IGNORE[]        = u"Ignore";
 
 namespace framework
 {
@@ -275,7 +275,7 @@ bool MenuBarMerger::ProcessMergeOperation(
     Menu*                     pMenu,
     sal_uInt16                nPos,
     sal_uInt16&               nItemId,
-    const OUString&    rMergeCommand,
+    std::u16string_view rMergeCommand,
     const OUString&    rMergeCommandParameter,
     const OUString&    rModuleIdentifier,
     const AddonMenuContainer& rAddonMenuItems )
@@ -307,8 +307,8 @@ bool MenuBarMerger::ProcessMergeOperation(
 bool MenuBarMerger::ProcessFallbackOperation(
     const ReferencePathInfo&                aRefPathInfo,
     sal_uInt16&                             rItemId,
-    const OUString&                  rMergeCommand,
-    const OUString&                  rMergeFallback,
+    std::u16string_view              rMergeCommand,
+    std::u16string_view              rMergeFallback,
     const ::std::vector< OUString >& rReferencePath,
     const std::u16string_view        rModuleIdentifier,
     const AddonMenuContainer&               rAddonMenuItems )
diff --git a/framework/source/uielement/statusbarmerger.cxx b/framework/source/uielement/statusbarmerger.cxx
index b9f21c5f8a89..38e266009aca 100644
--- a/framework/source/uielement/statusbarmerger.cxx
+++ b/framework/source/uielement/statusbarmerger.cxx
@@ -25,10 +25,10 @@ namespace framework
 {
 namespace {
 
-const char MERGECOMMAND_ADDAFTER[]       = "AddAfter";
-const char MERGECOMMAND_ADDBEFORE[]      = "AddBefore";
-const char MERGECOMMAND_REPLACE[]        = "Replace";
-const char MERGECOMMAND_REMOVE[]         = "Remove";
+const char16_t MERGECOMMAND_ADDAFTER[]   = u"AddAfter";
+const char16_t MERGECOMMAND_ADDBEFORE[]  = u"AddBefore";
+const char16_t MERGECOMMAND_REPLACE[]    = u"Replace";
+const char16_t MERGECOMMAND_REMOVE[]     = u"Remove";
 
 void lcl_ConvertSequenceToValues(
     const Sequence< PropertyValue > &rSequence,
@@ -189,7 +189,7 @@ bool StatusbarMerger::ProcessMergeOperation(
     StatusBar* pStatusbar,
     sal_uInt16 nPos,
     sal_uInt16& rItemId,
-    const OUString& rMergeCommand,
+    std::u16string_view rMergeCommand,
     const OUString& rMergeCommandParameter,
     const AddonStatusbarItemContainer& rItems )
 {
@@ -208,7 +208,7 @@ bool StatusbarMerger::ProcessMergeOperation(
 bool StatusbarMerger::ProcessMergeFallback(
     StatusBar* pStatusbar,
     sal_uInt16& rItemId,
-    const OUString& rMergeCommand,
+    std::u16string_view rMergeCommand,
     std::u16string_view rMergeFallback,
     const AddonStatusbarItemContainer& rItems )
 {
diff --git a/framework/source/uielement/toolbarmerger.cxx b/framework/source/uielement/toolbarmerger.cxx
index 89847cf47135..294e34cbc30f 100644
--- a/framework/source/uielement/toolbarmerger.cxx
+++ b/framework/source/uielement/toolbarmerger.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/toolbarmerger.hxx>
 #include <framework/generictoolbarcontroller.hxx>
 
@@ -40,25 +44,25 @@ const char MERGE_TOOLBAR_TARGET[]          = "Target";
 const char MERGE_TOOLBAR_CONTROLTYPE[]     = "ControlType";
 const char MERGE_TOOLBAR_WIDTH[]           = "Width";
 
-const char MERGECOMMAND_ADDAFTER[]         = "AddAfter";
-const char MERGECOMMAND_ADDBEFORE[]        = "AddBefore";
-const char MERGECOMMAND_REPLACE[]          = "Replace";
-const char MERGECOMMAND_REMOVE[]           = "Remove";
-
-const char MERGEFALLBACK_ADDLAST[]         = "AddLast";
-const char MERGEFALLBACK_ADDFIRST[]        = "AddFirst";
-const char MERGEFALLBACK_IGNORE[]          = "Ignore";
-
-const char TOOLBARCONTROLLER_BUTTON[]      = "Button";
-const char TOOLBARCONTROLLER_COMBOBOX[]    = "Combobox";
-const char TOOLBARCONTROLLER_EDIT[]        = "Editfield";
-const char TOOLBARCONTROLLER_SPINFIELD[]   = "Spinfield";
-const char TOOLBARCONTROLLER_IMGBUTTON[]   = "ImageButton";
-const char TOOLBARCONTROLLER_DROPDOWNBOX[] = "Dropdownbox";
-const char TOOLBARCONTROLLER_DROPDOWNBTN[] = "DropdownButton";
-const char TOOLBARCONTROLLER_TOGGLEDDBTN[] = "ToggleDropdownButton";
-const char TOOLBARCONTROLLER_FIXEDIMAGE[]  = "FixedImage";
-const char TOOLBARCONTROLLER_FIXEDTEXT[]   = "FixedText";
+const char16_t MERGECOMMAND_ADDAFTER[]     = u"AddAfter";
+const char16_t MERGECOMMAND_ADDBEFORE[]    = u"AddBefore";
+const char16_t MERGECOMMAND_REPLACE[]      = u"Replace";
+const char16_t MERGECOMMAND_REMOVE[]       = u"Remove";
+
+const char16_t MERGEFALLBACK_ADDLAST[]     = u"AddLast";
+const char16_t MERGEFALLBACK_ADDFIRST[]    = u"AddFirst";
+const char16_t MERGEFALLBACK_IGNORE[]      = u"Ignore";
+
+const char16_t TOOLBARCONTROLLER_BUTTON[]  = u"Button";
+const char16_t TOOLBARCONTROLLER_COMBOBOX[] = u"Combobox";
+const char16_t TOOLBARCONTROLLER_EDIT[]    = u"Editfield";
+const char16_t TOOLBARCONTROLLER_SPINFIELD[] = u"Spinfield";
+const char16_t TOOLBARCONTROLLER_IMGBUTTON[] = u"ImageButton";
+const char16_t TOOLBARCONTROLLER_DROPDOWNBOX[] = u"Dropdownbox";
+const char16_t TOOLBARCONTROLLER_DROPDOWNBTN[] = u"DropdownButton";
+const char16_t TOOLBARCONTROLLER_TOGGLEDDBTN[] = u"ToggleDropdownButton";
+const char16_t TOOLBARCONTROLLER_FIXEDIMAGE[] = u"FixedImage";
+const char16_t TOOLBARCONTROLLER_FIXEDTEXT[] = u"FixedText";
 
 const char   TOOLBOXITEM_SEPARATOR_STR[]   = "private:separator";
 
@@ -302,7 +306,7 @@ bool ToolBarMerger::ProcessMergeOperation(
     sal_uInt16&                            rItemId,
     CommandToInfoMap&                      rCommandMap,
     std::u16string_view                    rModuleIdentifier,
-    const OUString&                        rMergeCommand,
+    std::u16string_view                    rMergeCommand,
     const OUString&                        rMergeCommandParameter,
     const AddonToolbarItemContainer&       rItems )
 {
@@ -365,8 +369,8 @@ bool ToolBarMerger::ProcessMergeFallback(
     sal_uInt16&                      rItemId,
     CommandToInfoMap&                rCommandMap,
     std::u16string_view       rModuleIdentifier,
-    const OUString&           rMergeCommand,
-    const OUString&           rMergeFallback,
+    std::u16string_view       rMergeCommand,
+    std::u16string_view       rMergeFallback,
     const AddonToolbarItemContainer& rItems )
 {
     if (( rMergeFallback == MERGEFALLBACK_IGNORE ) ||
@@ -585,7 +589,7 @@ void ToolBarMerger::RemoveItems(
     const OUString& rCommandURL,
     sal_uInt16             nId,
     sal_uInt16             nWidth,
-    const OUString& rControlType )
+    std::u16string_view rControlType )
 {
     ::cppu::OWeakObject* pResult( nullptr );
 
diff --git a/i18npool/inc/indexentrysupplier_default.hxx b/i18npool/inc/indexentrysupplier_default.hxx
index 29fe3cdbf214..f45dd8f8b2d3 100644
--- a/i18npool/inc/indexentrysupplier_default.hxx
+++ b/i18npool/inc/indexentrysupplier_default.hxx
@@ -22,6 +22,7 @@
 #include "indexentrysupplier_common.hxx"
 
 #include <memory>
+#include <string_view>
 
 namespace i18npool {
 
@@ -85,7 +86,7 @@ public:
     void init(const css::lang::Locale& rLocale, const OUString& algorithm);
 
     /// @throws css::uno::RuntimeException
-    void makeIndexKeys(const css::lang::Locale &rLocale, const OUString &algorithm);
+    void makeIndexKeys(const css::lang::Locale &rLocale, std::u16string_view algorithm);
     sal_Int16 getIndexWeight(const OUString& rIndexEntry);
     OUString getIndexDescription(const OUString& rIndexEntry);
 
diff --git a/i18npool/inc/localedata.hxx b/i18npool/inc/localedata.hxx
index 19933376776f..327e9c196bc7 100644
--- a/i18npool/inc/localedata.hxx
+++ b/i18npool/inc/localedata.hxx
@@ -31,6 +31,7 @@
 #include <rtl/ref.hxx>
 #include <rtl/ustring.hxx>
 #include <vector>
+#include <string_view>
 #include <memory>
 #include <osl/module.hxx>
 
@@ -79,7 +80,7 @@ public:
     virtual css::uno::Sequence< css::i18n::FormatElement > SAL_CALL getAllFormats( const css::lang::Locale& rLocale ) override;
     virtual css::uno::Sequence< css::i18n::Implementation > SAL_CALL getCollatorImplementations( const css::lang::Locale& rLocale ) override;
     /// @throws css::uno::RuntimeException
-    OUString getCollatorRuleByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm );
+    OUString getCollatorRuleByAlgorithm( const css::lang::Locale& rLocale, std::u16string_view algorithm );
     virtual css::uno::Sequence< OUString > SAL_CALL getTransliterations( const css::lang::Locale& rLocale ) override;
     virtual css::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters( const css::lang::Locale& rLocale ) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getReservedWord( const css::lang::Locale& rLocale ) override ;
@@ -106,9 +107,10 @@ public:
     /// @throws css::uno::RuntimeException
     OUString getDefaultIndexAlgorithm( const css::lang::Locale& rLocale );
     /// @throws css::uno::RuntimeException
-    OUString getIndexKeysByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm );
+    OUString getIndexKeysByAlgorithm(
+        const css::lang::Locale& rLocale, std::u16string_view algorithm );
     /// @throws css::uno::RuntimeException
-    OUString getIndexModuleByAlgorithm( const css::lang::Locale& rLocale, const OUString& algorithm );
+    OUString getIndexModuleByAlgorithm( const css::lang::Locale& rLocale, std::u16string_view algorithm );
     /// @throws css::uno::RuntimeException
     css::uno::Sequence< css::i18n::UnicodeScript > getUnicodeScripts( const css::lang::Locale& rLocale );
     /// @throws css::uno::RuntimeException
@@ -116,7 +118,7 @@ public:
     /// @throws css::uno::RuntimeException
     bool hasPhonetic( const css::lang::Locale& rLocale );
     /// @throws css::uno::RuntimeException
-    bool isPhonetic( const css::lang::Locale& rLocale, const OUString& algorithm );
+    bool isPhonetic( const css::lang::Locale& rLocale, std::u16string_view algorithm );
     /// @throws css::uno::RuntimeException
     OUString getHangingCharacters( const css::lang::Locale& rLocale );
 
@@ -133,7 +135,7 @@ private:
     /// @throws css::uno::RuntimeException
     oslGenericFunction getFunctionSymbol( const css::lang::Locale& rLocale, const char* pFunction );
     sal_Unicode ** getIndexArray(const css::lang::Locale& rLocale, sal_Int16& indexCount);
-    sal_Unicode ** getIndexArrayForAlgorithm(const css::lang::Locale& rLocale, const OUString& rAlgorithm);
+    sal_Unicode ** getIndexArrayForAlgorithm(const css::lang::Locale& rLocale, std::u16string_view rAlgorithm);
     /// @throws css::uno::RuntimeException
     css::uno::Sequence< css::i18n::CalendarItem2 > &
         getCalendarItemByName(const OUString& name,
diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx
index 399b19b17382..519c99ce860e 100644
--- a/i18npool/source/indexentry/indexentrysupplier_default.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx
@@ -165,7 +165,7 @@ OUString Index::getIndexDescription(const OUString& rIndexEntry)
 
 #define LOCALE_EN lang::Locale("en", OUString(), OUString())
 
-void Index::makeIndexKeys(const lang::Locale &rLocale, const OUString &algorithm)
+void Index::makeIndexKeys(const lang::Locale &rLocale, std::u16string_view algorithm)
 {
     OUString keyStr = LocaleDataImpl::get()->getIndexKeysByAlgorithm(rLocale, algorithm);
 
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index ac4950741129..273415d9461e 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -922,7 +922,7 @@ LocaleDataImpl::getDateAcceptancePatterns( const Locale& rLocale )
 #define COLLATOR_ELEMENTS       3
 
 OUString
-LocaleDataImpl::getCollatorRuleByAlgorithm( const Locale& rLocale, const OUString& algorithm )
+LocaleDataImpl::getCollatorRuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
 {
     MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getCollatorImplementation" ));
     if ( func ) {
@@ -1059,7 +1059,7 @@ LocaleDataImpl::hasPhonetic( const Locale& rLocale )
 }
 
 sal_Unicode **
-LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, const OUString& algorithm)
+LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, std::u16string_view algorithm)
 {
     sal_Int16 indexCount = 0;
     sal_Unicode **indexArray = getIndexArray(rLocale, indexCount);
@@ -1073,21 +1073,21 @@ LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, const OUString&
 }
 
 bool
-LocaleDataImpl::isPhonetic( const Locale& rLocale, const OUString& algorithm )
+LocaleDataImpl::isPhonetic( const Locale& rLocale, std::u16string_view algorithm )
 {
     sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
     return indexArray && indexArray[4][0];
 }
 
 OUString
-LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, const OUString& algorithm )
+LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
 {
     sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
     return indexArray ? (OUString::Concat(u"0-9") + indexArray[2]) : OUString();
 }
 
 OUString
-LocaleDataImpl::getIndexModuleByAlgorithm( const Locale& rLocale, const OUString& algorithm )
+LocaleDataImpl::getIndexModuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
 {
     sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
     return indexArray ? OUString(indexArray[1]) : OUString();
diff --git a/include/comphelper/graphicmimetype.hxx b/include/comphelper/graphicmimetype.hxx
index 53ffd49888e4..94a3cd3cd093 100644
--- a/include/comphelper/graphicmimetype.hxx
+++ b/include/comphelper/graphicmimetype.hxx
@@ -10,6 +10,10 @@
 #ifndef INCLUDED_COMPHELPER_GMH_HXX
 #define INCLUDED_COMPHELPER_GMH_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <comphelper/comphelperdllapi.h>
 #include <rtl/ustring.hxx>
 #include <vcl/salctype.hxx>
@@ -30,7 +34,7 @@ namespace comphelper
 class COMPHELPER_DLLPUBLIC GraphicMimeTypeHelper
 {
 public:
-    static OUString GetMimeTypeForExtension(const OString& rExt);
+    static OUString GetMimeTypeForExtension(std::string_view rExt);
     static OUString
     GetMimeTypeForXGraphic(const css::uno::Reference<css::graphic::XGraphic>& xGraphic);
     static OUString
diff --git a/include/sfx2/XmlIdRegistry.hxx b/include/sfx2/XmlIdRegistry.hxx
index 9e08bf4bba06..a2b4b2129760 100644
--- a/include/sfx2/XmlIdRegistry.hxx
+++ b/include/sfx2/XmlIdRegistry.hxx
@@ -41,7 +41,7 @@ namespace sfx2 {
 /** is i_rIdref a valid NCName ? */
 bool SFX2_DLLPUBLIC isValidNCName(std::u16string_view i_rIdref);
 
-bool SFX2_DLLPUBLIC isValidXmlId(OUString const & i_rStreamName,
+bool SFX2_DLLPUBLIC isValidXmlId(std::u16string_view i_rStreamName,
     std::u16string_view i_rIdref);
 
 // XML ID handling ---------------------------------------------------
diff --git a/include/sfx2/mailmodelapi.hxx b/include/sfx2/mailmodelapi.hxx
index 8ee361cd7908..f701b98972ae 100644
--- a/include/sfx2/mailmodelapi.hxx
+++ b/include/sfx2/mailmodelapi.hxx
@@ -23,6 +23,7 @@
 #include <rtl/ustring.hxx>
 #include <sfx2/dllapi.h>
 #include <vector>
+#include <string_view>
 #include <memory>
 
 namespace com::sun::star::beans { struct PropertyValue; }
@@ -59,7 +60,7 @@ private:
     static SaveResult   ShowFilterOptionsDialog( const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR,
                                                  const css::uno::Reference< css::frame::XModel >& xModel,
                                                  const OUString& rFilterName,
-                                                 const OUString& rType,
+                                                 std::u16string_view rType,
                                                  bool bModified,
                                                  sal_Int32& rNumArgs,
                                                  css::uno::Sequence< css::beans::PropertyValue >& rArgs );
diff --git a/include/xmloff/SettingsExportHelper.hxx b/include/xmloff/SettingsExportHelper.hxx
index 784c8dd67075..0ee9f3ea4ee3 100644
--- a/include/xmloff/SettingsExportHelper.hxx
+++ b/include/xmloff/SettingsExportHelper.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_XMLOFF_SETTINGSEXPORTHELPER_HXX
 #define INCLUDED_XMLOFF_SETTINGSEXPORTHELPER_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <xmloff/dllapi.h>
 
 #include <com/sun/star/uno/Reference.hxx>
@@ -47,7 +51,7 @@ class XMLOFF_DLLPUBLIC XMLSettingsExportHelper
 
     css::uno::Reference< css::util::XStringSubstitution > mxStringSubstitution;
 
-    void ManipulateSetting( css::uno::Any& rAny, const OUString& rName ) const;
+    void ManipulateSetting( css::uno::Any& rAny, std::u16string_view rName ) const;
 
     void CallTypeFunction(const css::uno::Any& rAny,
                         const OUString& rName) const;
diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx
index 1aa3bab4b6d8..9b1ac7f14308 100644
--- a/l10ntools/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -260,7 +260,7 @@ void handleFilesOfDir(
         handleFile(rProject, elem, rPotDir);
 }
 
-bool includeProject(const OString& rProject) {
+bool includeProject(std::string_view rProject) {
     static const char *projects[] = {
         "include",
         "accessibility",
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 7cb7cbf30b63..f68cc4a62a1a 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -145,8 +145,8 @@ const char pFilterXML[]      = "StarOffice XML (Calc)";
 const OUStringLiteral pFilterAscii = u"" SC_TEXT_CSV_FILTER_NAME;
 const OUStringLiteral pFilterLotus = u"Lotus";
 const char pFilterQPro6[]    = "Quattro Pro 6.0";
-const char pFilterExcel4[]   = "MS Excel 4.0";
-const char pFilterEx4Temp[]  = "MS Excel 4.0 Vorlage/Template";
+const char16_t pFilterExcel4[] = u"MS Excel 4.0";
+const char16_t pFilterEx4Temp[] = u"MS Excel 4.0 Vorlage/Template";
 const char pFilterExcel5[]   = "MS Excel 5.0/95";
 const char pFilterEx5Temp[]  = "MS Excel 5.0/95 Vorlage/Template";
 const char pFilterExcel95[]  = "MS Excel 95";
@@ -155,10 +155,10 @@ const char pFilterExcel97[]  = "MS Excel 97";
 const char pFilterEx97Temp[] = "MS Excel 97 Vorlage/Template";
 const OUStringLiteral pFilterDBase = u"dBase";
 const OUStringLiteral pFilterDif = u"DIF";
-const char pFilterSylk[]     = "SYLK";
+const char16_t pFilterSylk[] = u"SYLK";
 const OUStringLiteral pFilterHtml = u"HTML (StarCalc)";
 const OUStringLiteral pFilterHtmlWebQ = u"calc_HTML_WebQuery";
-const char pFilterRtf[]      = "Rich Text Format (StarCalc)";
+const char16_t pFilterRtf[]  = u"Rich Text Format (StarCalc)";
 
 #define ShellClass_ScDocShell
 #include <scslots.hxx>
@@ -2710,7 +2710,7 @@ OUString ScDocShell::GetDifFilterName()
     return pFilterDif;
 }
 
-bool ScDocShell::HasAutomaticTableName( const OUString& rFilter )
+bool ScDocShell::HasAutomaticTableName( std::u16string_view rFilter )
 {
     //  sal_True for those filters that keep the default table name
     //  (which is language specific)
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 849b05f95def..6682979adc7d 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -34,6 +34,7 @@
 #include <docuno.hxx>
 
 #include <memory>
+#include <string_view>
 #include <unordered_map>
 #include <map>
 
@@ -397,7 +398,7 @@ public:
     static OUString   GetLotusFilterName();
     static OUString   GetDBaseFilterName();
     static OUString   GetDifFilterName();
-    static bool       HasAutomaticTableName( const OUString& rFilter );
+    static bool       HasAutomaticTableName( std::u16string_view rFilter );
     static void       LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument* pDocument, const ScAddress& rPos, const ScPostIt* pNote);
 
     DECL_LINK( RefreshDBDataHdl, Timer*, void );
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 7b274dd7210f..bdf0a1f52893 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -122,7 +122,7 @@ bool LayerTabBar::IsLocalizedNameOfStandardLayer(std::u16string_view rName)
             || rName == SdResId(STR_LAYER_BCKGRNDOBJ) );
 }
 
-bool LayerTabBar::IsRealNameOfStandardLayer(const OUString& rName)
+bool LayerTabBar::IsRealNameOfStandardLayer(std::u16string_view rName)
 {
     return (   rName == sUNO_LayerName_layout
             || rName == sUNO_LayerName_controls
diff --git a/sd/source/ui/inc/LayerTabBar.hxx b/sd/source/ui/inc/LayerTabBar.hxx
index a7fbefc4fb35..50e565166118 100644
--- a/sd/source/ui/inc/LayerTabBar.hxx
+++ b/sd/source/ui/inc/LayerTabBar.hxx
@@ -20,6 +20,10 @@
 #ifndef INCLUDED_SD_SOURCE_UI_INC_LAYERTABBAR_HXX
 #define INCLUDED_SD_SOURCE_UI_INC_LAYERTABBAR_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include <svtools/tabbar.hxx>
 #include <vcl/transfer.hxx>
 #include <sddllapi.h>
@@ -66,7 +70,7 @@ public:
     OUString            GetLayerName(sal_uInt16 nPageId) const;
 
     // Used e.g. in DeleteActualLayer() to test whether deleting is allowed.
-    static bool IsRealNameOfStandardLayer(const OUString& rName);
+    static bool IsRealNameOfStandardLayer(std::u16string_view rName);
 
     // Used e.g. in validity test of user entered names
     static bool IsLocalizedNameOfStandardLayer(std::u16string_view rName);
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 4373284d7708..7f1986c35030 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -45,6 +45,7 @@
 #include <map>
 #include <utility>
 #include <memory>
+#include <string_view>
 #include <vector>
 
 using namespace ::com::sun::star;
@@ -319,7 +320,7 @@ private:
     ToolBarRules maToolBarRules;
 
     static OUString GetToolBarResourceName (const OUString& rsBaseName);
-    bool CheckPlugInMode (const OUString& rsName) const;
+    bool CheckPlugInMode (std::u16string_view rsName) const;
 
     DECL_LINK(UpdateCallback, void *, void);
     DECL_LINK(EventMultiplexerCallback, sd::tools::EventMultiplexerEvent&, void);
@@ -863,7 +864,7 @@ OUString ToolBarManager::Implementation::GetToolBarResourceName (
     return "private:resource/toolbar/" + rsBaseName;
 }
 
-bool ToolBarManager::Implementation::CheckPlugInMode (const OUString& rsName) const
+bool ToolBarManager::Implementation::CheckPlugInMode (std::u16string_view rsName) const
 {
     bool bValid (false);
 
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 786d98e93987..b468d35988e4 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -107,13 +107,13 @@ void PrepareListener_Impl::disposing(const css::lang::EventObject& /*rEvent*/)
 
 // class SfxMailModel -----------------------------------------------
 
-const char       PDF_DOCUMENT_TYPE[]   = "pdf_Portable_Document_Format";
+const char16_t   PDF_DOCUMENT_TYPE[]   = u"pdf_Portable_Document_Format";
 
 SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog(
     const uno::Reference< lang::XMultiServiceFactory >& xSMGR,
     const uno::Reference< frame::XModel >& xModel,
     const OUString& rFilterName,
-    const OUString& rType,
+    std::u16string_view rType,
     bool bModified,
     sal_Int32& rNumArgs,
     css::uno::Sequence< css::beans::PropertyValue >& rArgs )
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 39664cc1d3b4..5f109cdf3f54 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -56,6 +56,7 @@
 
 #include <vector>
 #include <set>
+#include <string_view>
 
 #include <com/sun/star/uri/XUriReference.hpp>
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
@@ -90,26 +91,26 @@ const OUStringLiteral s_manifest = u"manifest.rdf";
 const char s_odfmime [] = "application/vnd.oasis.opendocument.";
 
 
-static bool isContentFile(OUString const & i_rPath)
+static bool isContentFile(std::u16string_view i_rPath)
 {
     return i_rPath == s_content;
 }
 
-static bool isStylesFile (OUString const & i_rPath)
+static bool isStylesFile (std::u16string_view i_rPath)
 {
     return i_rPath == s_styles;
 }
 
-bool isValidXmlId(OUString const & i_rStreamName,
+bool isValidXmlId(std::u16string_view i_rStreamName,
     std::u16string_view i_rIdref)
 {
     return isValidNCName(i_rIdref)
         && (isContentFile(i_rStreamName) || isStylesFile(i_rStreamName));
 }
 
-static bool isReservedFile(OUString const & i_rPath)
+static bool isReservedFile(std::u16string_view i_rPath)
 {
-    return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == "meta.xml" || i_rPath == "settings.xml";
+    return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == u"meta.xml" || i_rPath == u"settings.xml";
 }
 
 
@@ -555,18 +556,16 @@ static void
 collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage,
     std::set< OUString > & o_rFiles)
 {
-    static OUString content(s_content);
-    static OUString styles(s_styles );
     try {
-        if (i_xStorage->hasByName(content) &&
-            i_xStorage->isStreamElement(content))
+        if (i_xStorage->hasByName(s_content) &&
+            i_xStorage->isStreamElement(s_content))
         {
-            o_rFiles.insert(content);
+            o_rFiles.insert(s_content);
         }
-        if (i_xStorage->hasByName(styles) &&
-            i_xStorage->isStreamElement(styles))
+        if (i_xStorage->hasByName(s_styles) &&
+            i_xStorage->isStreamElement(s_styles))
         {
-            o_rFiles.insert(styles);
+            o_rFiles.insert(s_styles);
         }
     } catch (const uno::Exception &) {
         TOOLS_WARN_EXCEPTION("sfx", "collectFilesFromStorage");
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index 9f7b97bc36c7..e77546076df3 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -32,6 +32,7 @@
 
 #include <algorithm>
 #include <memory>
+#include <string_view>
 #include <unordered_map>
 #if OSL_DEBUG_LEVEL > 0
 #include <typeinfo>
@@ -111,15 +112,15 @@ using ::sfx2::isValidXmlId;
 
 namespace sfx2 {
 
-const char s_content [] = "content.xml";
-const char s_styles  [] = "styles.xml";
+const OUStringLiteral s_content = u"content.xml";
+const OUStringLiteral s_styles  = u"styles.xml";
 
-static bool isContentFile(OUString const & i_rPath)
+static bool isContentFile(std::u16string_view i_rPath)
 {
     return i_rPath == s_content;
 }
 
-static bool isStylesFile (OUString const & i_rPath)
+static bool isStylesFile (std::u16string_view i_rPath)
 {
     return i_rPath == s_styles;
 }
@@ -453,20 +454,20 @@ struct XmlIdRegistryDocument::XmlIdRegistry_Impl
         : m_XmlIdMap(), m_XmlIdReverseMap() { }
 
     bool TryInsertMetadatable(Metadatable& i_xObject,
-        const OUString & i_rStream, const OUString & i_rIdref);
+        std::u16string_view i_rStream, const OUString & i_rIdref);
 
     bool LookupXmlId(const Metadatable& i_xObject,
         OUString & o_rStream, OUString & o_rIdref) const;
 
-    Metadatable* LookupElement(const OUString & i_rStreamName,
+    Metadatable* LookupElement(std::u16string_view i_rStreamName,
         const OUString & i_rIdref) const;
 
     const XmlIdVector_t * LookupElementVector(
-        const OUString & i_rStreamName,
+        std::u16string_view i_rStreamName,
         const OUString & i_rIdref) const;
 
           XmlIdVector_t * LookupElementVector(
-        const OUString & i_rStreamName,
+        std::u16string_view i_rStreamName,
         const OUString & i_rIdref)
     {
         return const_cast<XmlIdVector_t*>(
@@ -481,7 +482,7 @@ struct XmlIdRegistryDocument::XmlIdRegistry_Impl
 
 static void
 rmIter(XmlIdMap_t & i_rXmlIdMap, XmlIdMap_t::iterator const& i_rIter,
-    OUString const & i_rStream, Metadatable const& i_rObject)
+    std::u16string_view i_rStream, Metadatable const& i_rObject)
 {
     if (i_rIter != i_rXmlIdMap.end())
     {
@@ -498,7 +499,7 @@ rmIter(XmlIdMap_t & i_rXmlIdMap, XmlIdMap_t::iterator const& i_rIter,
 
 const XmlIdVector_t *
 XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElementVector(
-    const OUString & i_rStreamName,
+    std::u16string_view i_rStreamName,
     const OUString & i_rIdref) const
 {
     const XmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) );
@@ -518,7 +519,7 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElementVector(
 
 Metadatable*
 XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement(
-    const OUString & i_rStreamName,
+    std::u16string_view i_rStreamName,
     const OUString & i_rIdref) const
 {
     if (!isValidXmlId(i_rStreamName, i_rIdref))
@@ -568,7 +569,7 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupXmlId(
 bool
 XmlIdRegistryDocument::XmlIdRegistry_Impl::TryInsertMetadatable(
     Metadatable & i_rObject,
-    const OUString & i_rStreamName, const OUString & i_rIdref)
+    std::u16string_view i_rStreamName, const OUString & i_rIdref)
 {
     const bool bContent( isContentFile(i_rStreamName) );
     OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName),
@@ -722,8 +723,8 @@ XmlIdRegistryDocument::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
         "RegisterMetadatableAndCreateID called for MetadatableClipboard?");
 
     const bool isInContent( i_rObject.IsInContent() );
-    const OUString stream( OUString::createFromAscii(
-        isInContent ? s_content : s_styles ) );
+    const OUString stream(
+        isInContent ? OUString(s_content) : OUString(s_styles) );
     // check if we have a latent xmlid, and if yes, remove it
     OUString old_path;
     OUString old_idref;
@@ -923,16 +924,16 @@ struct XmlIdRegistryClipboard::XmlIdRegistry_Impl
         : m_XmlIdMap(), m_XmlIdReverseMap() { }
 
     bool TryInsertMetadatable(Metadatable& i_xObject,
-        const OUString & i_rStream, const OUString & i_rIdref);
+        std::u16string_view i_rStream, const OUString & i_rIdref);
 
     bool LookupXmlId(const Metadatable& i_xObject,
         OUString & o_rStream, OUString & o_rIdref,
         MetadatableClipboard const* &o_rpLink) const;
 
-    Metadatable* LookupElement(const OUString & i_rStreamName,
+    Metadatable* LookupElement(std::u16string_view i_rStreamName,
         const OUString & i_rIdref) const;
 
-    Metadatable* const* LookupEntry(const OUString & i_rStreamName,
+    Metadatable* const* LookupEntry(std::u16string_view i_rStreamName,
         const OUString & i_rIdref) const;
 
     ClipboardXmlIdMap_t m_XmlIdMap;
@@ -943,7 +944,7 @@ struct XmlIdRegistryClipboard::XmlIdRegistry_Impl
 static void
 rmIter(ClipboardXmlIdMap_t & i_rXmlIdMap,
     ClipboardXmlIdMap_t::iterator const& i_rIter,
-    OUString const & i_rStream, Metadatable const& i_rObject)
+    std::u16string_view i_rStream, Metadatable const& i_rObject)
 {
     if (i_rIter == i_rXmlIdMap.end())
         return;
@@ -963,7 +964,7 @@ rmIter(ClipboardXmlIdMap_t & i_rXmlIdMap,
 
 Metadatable* const*
 XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry(
-    const OUString & i_rStreamName,
+    std::u16string_view i_rStreamName,
     const OUString & i_rIdref) const
 {
     if (!isValidXmlId(i_rStreamName, i_rIdref))
@@ -988,7 +989,7 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry(
 
 Metadatable*
 XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupElement(
-    const OUString & i_rStreamName,
+    std::u16string_view i_rStreamName,
     const OUString & i_rIdref) const
 {
     Metadatable * const * ppEntry = LookupEntry(i_rStreamName, i_rIdref);
@@ -1023,7 +1024,7 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupXmlId(
 bool
 XmlIdRegistryClipboard::XmlIdRegistry_Impl::TryInsertMetadatable(
     Metadatable & i_rObject,
-    const OUString & i_rStreamName, const OUString & i_rIdref)
+    std::u16string_view i_rStreamName, const OUString & i_rIdref)
 {
     bool bContent( isContentFile(i_rStreamName) );
     OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName),
@@ -1137,8 +1138,8 @@ XmlIdRegistryClipboard::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
         "RegisterMetadatableAndCreateID called for MetadatableClipboard?");
 
     bool isInContent( i_rObject.IsInContent() );
-    OUString stream( OUString::createFromAscii(
-        isInContent ? s_content : s_styles ) );
+    OUString stream(
+        isInContent ? OUString(s_content) : OUString(s_styles) );
 
     OUString old_path;
     OUString old_idref;
@@ -1296,8 +1297,7 @@ void Metadatable::SetMetadataReference( const css::beans::StringPair & i_rRefere
         {
             // handle empty stream name as auto-detect.
             // necessary for importing flat file format.
-            streamName = OUString::createFromAscii(
-                            IsInContent() ? s_content : s_styles );
+            streamName = IsInContent() ? OUString(s_content) : OUString(s_styles);
         }
         XmlIdRegistry & rReg( dynamic_cast<XmlIdRegistry&>( GetRegistry() ) );
         if (!rReg.TryRegisterMetadatable(*this, streamName, i_rReference.Second))
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index d532ff4aaeee..878f7f60f412 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -1032,7 +1032,7 @@ OString FmXFormShell::SlotToIdent(sal_uInt16 nSlot)
     return OString();
 }
 
-bool FmXFormShell::isControlConversionSlot(const OString& rIdent)
+bool FmXFormShell::isControlConversionSlot(std::string_view rIdent)
 {
     for (const auto& rConvertSlot : aConvertSlots)
         if (rIdent == rConvertSlot)
@@ -1040,7 +1040,7 @@ bool FmXFormShell::isControlConversionSlot(const OString& rIdent)
     return false;
 }
 
-void FmXFormShell::executeControlConversionSlot_Lock(const OString &rIdent)
+void FmXFormShell::executeControlConversionSlot_Lock(std::string_view rIdent)
 {
     OSL_PRECOND( canConvertCurrentSelectionToControl_Lock(rIdent), "FmXFormShell::executeControlConversionSlot: illegal call!" );
     InterfaceBag::const_iterator aSelectedElement = m_aCurrentSelection.begin();
@@ -1050,7 +1050,7 @@ void FmXFormShell::executeControlConversionSlot_Lock(const OString &rIdent)
     executeControlConversionSlot_Lock(Reference<XFormComponent>(*aSelectedElement, UNO_QUERY), rIdent);
 }
 
-bool FmXFormShell::executeControlConversionSlot_Lock(const Reference<XFormComponent>& _rxObject, const OString& rIdent)
+bool FmXFormShell::executeControlConversionSlot_Lock(const Reference<XFormComponent>& _rxObject, std::string_view rIdent)
 {
     if (impl_checkDisposed_Lock())
         return false;
@@ -1249,7 +1249,7 @@ bool FmXFormShell::executeControlConversionSlot_Lock(const Reference<XFormCompon
     return false;
 }
 
-bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(const OString& rIdent)
+bool FmXFormShell::canConvertCurrentSelectionToControl_Lock(std::string_view rIdent)
 {
     if ( m_aCurrentSelection.empty() )
         return false;
diff --git a/svx/source/inc/datanavi.hxx b/svx/source/inc/datanavi.hxx
index a208dc2062ef..3899fc3d3745 100644
--- a/svx/source/inc/datanavi.hxx
+++ b/svx/source/inc/datanavi.hxx
@@ -45,6 +45,7 @@
 #include "datalistener.hxx"
 
 #include <memory>
+#include <string_view>
 #include <vector>
 
 class FmFormShell;
@@ -98,7 +99,7 @@ namespace svxform
 
         /** convert submission replace string from API value to UI value.
             Use 'none' as default. */
-        OUString const & toUI( const OUString& rStr ) const
+        OUString const & toUI( std::u16string_view rStr ) const
         {
             if( rStr == m_sDoc_API )
                 return m_sDoc_UI;
@@ -143,7 +144,7 @@ namespace svxform
         }
 
         /** convert from API to UI; put is default. */
-        OUString const & toUI( const OUString& rStr ) const
+        OUString const & toUI( std::u16string_view rStr ) const
         {
             if( rStr == m_sGet_API )
                 return m_sGet_UI;
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index affa74dfcaf9..23bb34cc3a43 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -51,6 +51,7 @@
 #include <o3tl/typed_flags_set.hxx>
 
 #include <queue>
+#include <string_view>
 #include <vector>
 #include <memory>
 
@@ -411,17 +412,17 @@ public:
     SAL_DLLPRIVATE static void GetConversionMenu_Lock(weld::Menu& rMenu);
 
     /// checks whether a given control conversion slot can be applied to the current selection
-    SAL_DLLPRIVATE bool canConvertCurrentSelectionToControl_Lock(const OString& rIdent);
+    SAL_DLLPRIVATE bool canConvertCurrentSelectionToControl_Lock(std::string_view rIdent);
     /// enables or disables all conversion slots in a menu, according to the current selection
     SAL_DLLPRIVATE void checkControlConversionSlotsForCurrentSelection_Lock(weld::Menu& rMenu);
     /// executes a control conversion slot for a given object
-    SAL_DLLPRIVATE bool executeControlConversionSlot_Lock(const css::uno::Reference< css::form::XFormComponent >& _rxObject, const OString& rIdent);
+    SAL_DLLPRIVATE bool executeControlConversionSlot_Lock(const css::uno::Reference< css::form::XFormComponent >& _rxObject, std::string_view rIdent);
     /** executes a control conversion slot for the current selection
         @precond canConvertCurrentSelectionToControl( <arg>_nSlotId</arg> ) must return <TRUE/>
     */
-    SAL_DLLPRIVATE void executeControlConversionSlot_Lock(const OString& rIdent);
+    SAL_DLLPRIVATE void executeControlConversionSlot_Lock(std::string_view rIdent);
     /// checks whether the given slot id denotes a control conversion slot
-    SAL_DLLPRIVATE static bool isControlConversionSlot(const OString& rIdent);
+    SAL_DLLPRIVATE static bool isControlConversionSlot(std::string_view rIdent);
 
     SAL_DLLPRIVATE void ExecuteTextAttribute_Lock(SfxRequest& _rReq);
     SAL_DLLPRIVATE void GetTextAttributeState_Lock(SfxItemSet& _rSet);
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index c1bba2b64bb3..92094ffa5498 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_SW_INC_UNOSETT_HXX
 #define INCLUDED_SW_INC_UNOSETT_HXX
 
+#include <sal/config.h>
+
+#include <string_view>
+
 #include "swtypes.hxx"
 #include <com/sun/star/text/XTextColumns.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -204,7 +208,7 @@ public:
     const OUString*         GetBulletFontNames() const {return m_sNewBulletFontNames;}
     const SwNumRule*        GetNumRule() const {return m_pNumRule;}
 
-    static bool             isInvalidStyle(const OUString &rName);
+    static bool             isInvalidStyle(std::u16string_view rName);
     void    Invalidate()    {m_pDocShell = nullptr;}
     const OUString&   GetCreatedNumRuleName() const {return m_sCreatedNumRuleName;}
 
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 26905258e56b..bc91d6474272 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1003,7 +1003,7 @@ void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*
 OSL_FAIL("not implemented");
 }
 
-const char aInvalidStyle[] = "__XXX___invalid";
+const char16_t aInvalidStyle[] = u"__XXX___invalid";
 
 class SwXNumberingRules::Impl
     : public SvtListener
@@ -1014,7 +1014,7 @@ class SwXNumberingRules::Impl
         explicit Impl(SwXNumberingRules& rParent) : m_rParent(rParent) {}
 };
 
-bool SwXNumberingRules::isInvalidStyle(const OUString &rName)
+bool SwXNumberingRules::isInvalidStyle(std::u16string_view rName)
 {
     return rName == aInvalidStyle;
 }
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 36e246d7dbc1..e0c2f9fb8021 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -188,7 +188,7 @@ OString lclConvToHex(sal_uInt16 nHex)
 }
 }
 
-bool IgnorePropertyForReqIF(bool bReqIF, const OString& rProperty, std::string_view rValue)
+bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue)
 {
     if (!bReqIF)
         return false;
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index e5806da8fc97..26312473f7be 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -699,7 +699,7 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt );
 OString GetCSS1_Color(const Color& rColor);
 
 /// Determines if rProperty with a given rValue has to be suppressed due to ReqIF mode.
-bool IgnorePropertyForReqIF(bool bReqIF, const OString& rProperty, std::string_view rValue);
+bool IgnorePropertyForReqIF(bool bReqIF, std::string_view rProperty, std::string_view rValue);
 
 #endif // INCLUDED_SW_SOURCE_FILTER_HTML_WRTHTML_HXX
 
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 9e713839e082..04f9d677b9f0 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -33,6 +33,7 @@
 #include <cppuhelper/queryinterface.hxx>
 #include <ucbhelper/macros.hxx>
 #include <memory>
+#include <string_view>
 
 using namespace com::sun::star::beans;
 using namespace com::sun::star::lang;
@@ -380,7 +381,7 @@ private:
     impl_getPos( std::u16string_view rName ) const;
 
     static bool
-    impl_isMyPropertyName( const OUString& rName );
+    impl_isMyPropertyName( std::u16string_view rName );
 
 public:
     explicit CCRS_PropertySetInfo(   Reference<
@@ -409,8 +410,8 @@ public:
 };
 
 //some helping variables ( names for my special properties )
-const char g_sPropertyNameForCount[] = "RowCount";
-const char g_sPropertyNameForFinalCount[] = "IsRowCountFinal";
+const char16_t g_sPropertyNameForCount[] = u"RowCount";
+const char16_t g_sPropertyNameForFinalCount[] = u"IsRowCountFinal";
 constexpr OUStringLiteral g_sPropertyNameForFetchSize(u"FetchSize");
 constexpr OUStringLiteral g_sPropertyNameForFetchDirection(u"FetchDirection");
 
@@ -574,7 +575,7 @@ bool CCRS_PropertySetInfo
 
 //static
 bool CCRS_PropertySetInfo
-        ::impl_isMyPropertyName( const OUString& rPropertyName )
+        ::impl_isMyPropertyName( std::u16string_view rPropertyName )
 {
     return ( rPropertyName == g_sPropertyNameForCount
     || rPropertyName == g_sPropertyNameForFinalCount
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index 6c193e19267e..202e3322226f 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -473,7 +473,7 @@ void XMLSettingsExportHelper::exportAllSettings(
  * from their XML settings representation. This is your chance to do
  * so!
  */
-void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const OUString& rName ) const
+void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, std::u16string_view rName ) const
 {
     if( rName == gsPrinterIndependentLayout )
     {


More information about the Libreoffice-commits mailing list