cppu/source/uno/EnvStack.cxx        |    4 ++--
 cppu/source/uno/cascade_mapping.cxx |    4 ++--
 cppuhelper/source/typemanager.cxx   |    8 ++++----
 cppuhelper/source/typemanager.hxx   |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit a5343a89f898468178f04c241de0b2c2a314a1b5
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Apr 13 14:04:09 2022 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Wed Apr 13 16:11:49 2022 +0200

    use more string_view in cppu
    
    Change-Id: Ifd2ee4827e0083ffaff9120fee239fb16553380e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132957
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 880b922886d1..2daf56a21a79 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -141,7 +141,7 @@ extern "C" void SAL_CALL 
uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl
     }
 }
 
-static OUString s_getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString s_getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
     sal_Int32 nIndex1 = 0;
     sal_Int32 nIndex2 = 0;
@@ -163,7 +163,7 @@ static OUString s_getPrefix(OUString const & str1, 
std::u16string_view str2)
     OUString result;
 
     if (sim)
-        result = str1.copy(0, sim - 1);
+        result = str1.substr(0, sim - 1);
 
     return result;
 }
diff --git a/cppu/source/uno/cascade_mapping.cxx 
b/cppu/source/uno/cascade_mapping.cxx
index dbfbfc6c4dba..f03d88e529d6 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -156,7 +156,7 @@ extern "C" { static void s_MediatorMapping_free(uno_Mapping 
* pMapping)
 }}
 
 
-static OUString getPrefix(OUString const & str1, std::u16string_view str2)
+static OUString getPrefix(std::u16string_view str1, std::u16string_view str2)
 {
     sal_Int32 nIndex1 = 0;
     sal_Int32 nIndex2 = 0;
@@ -178,7 +178,7 @@ static OUString getPrefix(OUString const & str1, 
std::u16string_view str2)
     OUString result;
 
     if (sim)
-        result = str1.copy(0, sim - 1);
+        result = str1.substr(0, sim - 1);
 
     return result;
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 28ef85189f29..44105df033fa 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2149,15 +2149,15 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 }
 
 css::uno::Any cppuhelper::TypeManager::getInterfaceMember(
-    OUString const & name, sal_Int32 separator)
+    std::u16string_view name, sal_Int32 separator)
 {
-    assert(name.indexOf("::") == separator && separator != -1);
+    assert(static_cast<sal_Int32>(name.find(u"::")) == separator && separator 
!= -1);
     css::uno::Reference< css::reflection::XInterfaceTypeDescription2 > ifc(
-        resolveTypedefs(find(name.copy(0, separator))), css::uno::UNO_QUERY);
+        resolveTypedefs(find(OUString(name.substr(0, separator)))), 
css::uno::UNO_QUERY);
     if (!ifc.is()) {
         return css::uno::Any();
     }
-    OUString member(name.copy(separator + std::strlen("::")));
+    std::u16string_view member = name.substr(separator + std::strlen("::"));
     const css::uno::Sequence<
         css::uno::Reference<
             css::reflection::XInterfaceMemberTypeDescription > > mems(
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 1ee264bf16ff..28c193191267 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -100,7 +100,7 @@ private:
         OUString const & name, sal_Int32 separator);
 
     css::uno::Any getInterfaceMember(
-        OUString const & name, sal_Int32 separator);
+        std::u16string_view name, sal_Int32 separator);
 
     css::uno::Any getNamed(
         OUString const & name,

Reply via email to