comphelper/qa/string/test_string.cxx                |    8 ++---
 comphelper/source/misc/string.cxx                   |    8 ++---
 configmgr/source/access.cxx                         |    9 +++---
 connectivity/source/drivers/postgresql/pq_tools.cxx |   18 ++++++------
 connectivity/source/drivers/postgresql/pq_tools.hxx |    2 -
 editeng/source/misc/svxacorr.cxx                    |    2 -
 include/comphelper/string.hxx                       |    2 -
 include/editeng/svxacorr.hxx                        |    2 -
 include/jvmfwk/framework.hxx                        |    2 -
 include/sfx2/frmhtmlw.hxx                           |    8 ++---
 include/svl/urihelper.hxx                           |    2 -
 include/svtools/htmlout.hxx                         |    6 ++--
 include/test/screenshot_test.hxx                    |    2 -
 jvmfwk/source/framework.cxx                         |   30 ++++++++++++--------
 linguistic/source/misc.cxx                          |    1 
 sc/source/filter/html/htmlexp.cxx                   |    7 ++--
 sc/source/ui/dbgui/csvgrid.cxx                      |    6 ++--
 sc/source/ui/docshell/impex.cxx                     |   12 ++++----
 sc/source/ui/inc/csvgrid.hxx                        |    2 -
 sc/source/ui/inc/impex.hxx                          |    4 +-
 sd/source/filter/html/htmlex.cxx                    |    2 -
 sdext/source/pdfimport/inc/pdfiprocessor.hxx        |    2 -
 sdext/source/pdfimport/tree/pdfiprocessor.cxx       |    7 ++--
 sfx2/source/bastyp/frmhtmlw.cxx                     |    6 ++--
 stoc/source/uriproc/UriReferenceFactory.cxx         |   16 +++++-----
 svl/source/misc/urihelper.cxx                       |    6 ++--
 svl/source/numbers/zformat.cxx                      |    4 +-
 svtools/source/svhtml/htmlout.cxx                   |   17 ++++++-----
 sw/source/core/doc/SwStyleNameMapper.cxx            |    5 ++-
 sw/source/filter/html/htmldrawwriter.cxx            |    2 -
 sw/source/filter/html/htmlfldw.cxx                  |    4 +-
 sw/source/filter/html/htmlflywriter.cxx             |   10 +++---
 sw/source/filter/html/htmlforw.cxx                  |    2 -
 sw/source/filter/html/htmlftn.cxx                   |    2 -
 sw/source/filter/html/wrthtml.hxx                   |    4 +-
 test/source/screenshot_test.cxx                     |   28 ++++++++++++------
 ucbhelper/source/client/proxydecider.cxx            |   18 ++++++------
 vcl/inc/salframe.hxx                                |    2 -
 vcl/inc/textlayout.hxx                              |    2 -
 vcl/source/app/salvtables.cxx                       |   12 ++++----
 vcl/source/text/textlayout.cxx                      |    6 ++--
 41 files changed, 155 insertions(+), 135 deletions(-)

New commits:
commit 7840effb1d5efd1fd7f6798c7c504b05292a7793
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Feb 22 12:59:26 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Mar 8 07:06:13 2024 +0100

    use more string_view
    
    found by tweaking the stringview loplugin
    
    Change-Id: I92203ba99642bef7951ffa146184c5562cb31d09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163744
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/comphelper/qa/string/test_string.cxx 
b/comphelper/qa/string/test_string.cxx
index 5d25a64da887..ac79148a4c48 100644
--- a/comphelper/qa/string/test_string.cxx
+++ b/comphelper/qa/string/test_string.cxx
@@ -197,15 +197,15 @@ void TestString::testReverseString()
 }
 
 void TestString::testReverseCodePoints() {
-    CPPUNIT_ASSERT_EQUAL(OUString(), 
comphelper::string::reverseCodePoints(""));
-    CPPUNIT_ASSERT_EQUAL(OUString("cba"), 
comphelper::string::reverseCodePoints("abc"));
+    CPPUNIT_ASSERT_EQUAL(OUString(), 
comphelper::string::reverseCodePoints(u""));
+    CPPUNIT_ASSERT_EQUAL(OUString("cba"), 
comphelper::string::reverseCodePoints(u"abc"));
     CPPUNIT_ASSERT_EQUAL(
         u"w\U0010FFFFv\U00010000u"_ustr,
-        
comphelper::string::reverseCodePoints(u"u\U00010000v\U0010FFFFw"_ustr));
+        comphelper::string::reverseCodePoints(u"u\U00010000v\U0010FFFFw"));
     static sal_Unicode const malformed[] = {0xDC00, 0xD800};
     CPPUNIT_ASSERT_EQUAL(
         u"\U00010000"_ustr,
-        comphelper::string::reverseCodePoints(OUString(malformed, 
std::size(malformed))));
+        comphelper::string::reverseCodePoints(std::u16string_view(malformed, 
std::size(malformed))));
 }
 
 void TestString::testSplit()
diff --git a/comphelper/source/misc/string.cxx 
b/comphelper/source/misc/string.cxx
index e17951fc43be..1b9137e473c0 100644
--- a/comphelper/source/misc/string.cxx
+++ b/comphelper/source/misc/string.cxx
@@ -525,11 +525,11 @@ OUString reverseString(std::u16string_view rStr)
     return sBuf.makeStringAndClear();
 }
 
-OUString reverseCodePoints(OUString const & str) {
-    auto const len = str.getLength();
+OUString reverseCodePoints(std::u16string_view str) {
+    auto const len = str.size();
     OUStringBuffer buf(len);
-    for (auto i = len; i != 0;) {
-        buf.appendUtf32(str.iterateCodePoints(&i, -1));
+    for (sal_Int32 i = len; i != 0;) {
+        buf.appendUtf32(o3tl::iterateCodePoints(str, &i, -1));
     }
     return buf.makeStringAndClear();
 }
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 1e2d73dafe9c..c25cf73aaef0 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -84,6 +84,7 @@
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
 #include <sal/types.h>
+#include <o3tl/string_view.hxx>
 
 #include "access.hxx"
 #include "broadcaster.hxx"
@@ -109,9 +110,9 @@ namespace {
 // Conservatively forbid what is either not an XML Char (including lone
 // surrogates, even though they should not appear in well-formed UNO OUString
 // instances anyway), or is a slash (as it causes problems in path syntax):
-bool isValidName(OUString const & name, bool setMember) {
-    for (sal_Int32 i = 0; i != name.getLength();) {
-        sal_uInt32 c = name.iterateCodePoints(&i);
+bool isValidName(std::u16string_view name, bool setMember) {
+    for (sal_Int32 i = 0; i != static_cast<sal_Int32>(name.size());) {
+        sal_uInt32 c = o3tl::iterateCodePoints(name, &i);
         if ((c < 0x20 && !(c == 0x09 || c == 0x0A || c == 0x0D))
             || rtl::isSurrogate(c) || c == 0xFFFE || c == 0xFFFF
             || (!setMember && c == '/'))
@@ -119,7 +120,7 @@ bool isValidName(OUString const & name, bool setMember) {
             return false;
         }
     }
-    return !name.isEmpty();
+    return !name.empty();
 }
 
 }
diff --git a/connectivity/source/drivers/postgresql/pq_tools.cxx 
b/connectivity/source/drivers/postgresql/pq_tools.cxx
index 29e3584aacb6..fb42f864f97e 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.cxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.cxx
@@ -840,17 +840,17 @@ OUString 
getColExprForDefaultSettingVal(ConnectionSettings const *settings)
                OUString("pg_get_expr(pg_attrdef.adbin, pg_attrdef.adrelid, 
true)");
 }
 
-css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str )
+css::uno::Sequence< sal_Int32 > string2intarray( std::u16string_view str )
 {
     css::uno::Sequence< sal_Int32 > ret;
-    const sal_Int32 strlen = str.getLength();
-    if( str.getLength() > 1 )
+    const sal_Int32 strlen = str.size();
+    if( strlen > 1 )
     {
         sal_Int32 start = 0;
         sal_uInt32 c;
         for (;;)
         {
-            c = str.iterateCodePoints(&start);
+            c = o3tl::iterateCodePoints(str, &start);
             if (!iswspace(c))
                 break;
             if ( start == strlen)
@@ -860,7 +860,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const 
OUString & str )
             return ret;
         for (;;)
         {
-            c = str.iterateCodePoints(&start);
+            c = o3tl::iterateCodePoints(str, &start);
             if ( !iswspace(c) )
                 break;
             if ( start == strlen)
@@ -879,7 +879,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const 
OUString & str )
                     break;
                 if ( start == strlen)
                     return ret;
-                c=str.iterateCodePoints(&start);
+                c = o3tl::iterateCodePoints(str, &start);
             } while ( c );
             do
             {
@@ -888,7 +888,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const 
OUString & str )
                 if ( start == strlen)
                     return ret;
                 digits.append(OUString(&c, 1));
-                c = str.iterateCodePoints(&start);
+                c = o3tl::iterateCodePoints(str, &start);
             } while ( c );
             vec.push_back( o3tl::toInt32(digits) );
             do
@@ -897,11 +897,11 @@ css::uno::Sequence< sal_Int32 > string2intarray( const 
OUString & str )
                     break;
                 if ( start == strlen)
                     return ret;
-                c = str.iterateCodePoints(&start);
+                c = o3tl::iterateCodePoints(str, &start);
             } while ( c );
             if ( c == L'}' )
                 break;
-            if ( str.iterateCodePoints(&start) != L',' )
+            if ( o3tl::iterateCodePoints(str, &start) != L',' )
                 return ret;
             if ( start == strlen)
                 return ret;
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx 
b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 8a31e207cc1b..c5f9174111ca 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -131,7 +131,7 @@ void fillAttnum2attnameMap(
     const OUString &schema,
     const OUString &table );
 
-css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str );
+css::uno::Sequence< sal_Int32 > string2intarray( std::u16string_view str );
 
 css::uno::Sequence< OUString > convertMappedIntArray2StringArray(
     const Int2StringMap &map, const css::uno::Sequence< sal_Int32> &source );
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index a33d4f77ab67..b723c7958843 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -770,7 +770,7 @@ bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, 
const OUString& rTxt,
 }
 
 // DOI citation recognition
-bool SvxAutoCorrect::FnSetDOIAttr( SvxAutoCorrDoc& rDoc, const OUString& rTxt,
+bool SvxAutoCorrect::FnSetDOIAttr( SvxAutoCorrDoc& rDoc, std::u16string_view 
rTxt,
                                     sal_Int32 nSttPos, sal_Int32 nEndPos,
                                     LanguageType eLang )
 {
diff --git a/include/comphelper/string.hxx b/include/comphelper/string.hxx
index bab63f06f034..4cc5bf2ee64b 100644
--- a/include/comphelper/string.hxx
+++ b/include/comphelper/string.hxx
@@ -159,7 +159,7 @@ COMPHELPER_DLLPUBLIC OUString 
reverseString(std::u16string_view rStr);
 
 /** Reverse an OUString's Unicode code points.
 */
-COMPHELPER_DLLPUBLIC OUString reverseCodePoints(OUString const & str);
+COMPHELPER_DLLPUBLIC OUString reverseCodePoints(std::u16string_view str);
 
 
 namespace detail
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index 96415c20d8b6..4bc359ddf8f8 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -419,7 +419,7 @@ public:
     bool FnSetINetAttr( SvxAutoCorrDoc&, const OUString&,
                                 sal_Int32 nSttPos, sal_Int32 nEndPos,
                                 LanguageType eLang );
-    bool FnSetDOIAttr( SvxAutoCorrDoc&, const OUString&,
+    bool FnSetDOIAttr( SvxAutoCorrDoc&, std::u16string_view,
                                 sal_Int32 nSttPos, sal_Int32 nEndPos,
                                 LanguageType eLang );
     bool FnChgWeightUnderl( SvxAutoCorrDoc&, const OUString&,
diff --git a/include/jvmfwk/framework.hxx b/include/jvmfwk/framework.hxx
index 4eaacfce975d..752b6ccc4804 100644
--- a/include/jvmfwk/framework.hxx
+++ b/include/jvmfwk/framework.hxx
@@ -354,7 +354,7 @@ jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>>* 
parInfo);
  * @param sUserPath colon-separated string of user classpaths
  * @return list of user classpaths
  */
-JVMFWK_DLLPUBLIC std::vector<OUString> jfw_convertUserPathList(OUString const& 
sUserPath);
+JVMFWK_DLLPUBLIC std::vector<OUString> 
jfw_convertUserPathList(std::u16string_view sUserPath);
 
 /** determines if a path points to a Java installation.
 
diff --git a/include/sfx2/frmhtmlw.hxx b/include/sfx2/frmhtmlw.hxx
index 10faf52abcc6..e838787bc870 100644
--- a/include/sfx2/frmhtmlw.hxx
+++ b/include/sfx2/frmhtmlw.hxx
@@ -38,12 +38,12 @@ namespace com::sun::star::uno { template <class 
interface_type> class Reference;
 class SFX2_DLLPUBLIC SfxFrameHTMLWriter
 {
     SAL_DLLPRIVATE static void OutMeta( SvStream& rStrm,
-                                const char *pIndent, const OUString& rName,
-                                const OUString& rContent, bool bHTTPEquiv,
+                                const char *pIndent, std::u16string_view rName,
+                                std::u16string_view rContent, bool bHTTPEquiv,
                                 OUString *pNonConvertableChars = nullptr );
     SAL_DLLPRIVATE inline static void OutMeta( SvStream& rStrm,
                                 const char *pIndent, const char *pName,
-                                const OUString& rContent, bool bHTTPEquiv,
+                                std::u16string_view rContent, bool bHTTPEquiv,
                                 OUString *pNonConvertableChars = nullptr );
 
 public:
@@ -58,7 +58,7 @@ public:
 
 inline void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
                             const char *pIndent, const char *pName,
-                            const OUString& rContent, bool bHTTPEquiv,
+                            std::u16string_view rContent, bool bHTTPEquiv,
                             OUString *pNonConvertableChars )
 {
     OUString sTmp = OUString::createFromAscii(pName);
diff --git a/include/svl/urihelper.hxx b/include/svl/urihelper.hxx
index 68843c17a85c..fec311d9f502 100644
--- a/include/svl/urihelper.hxx
+++ b/include/svl/urihelper.hxx
@@ -120,7 +120,7 @@ SVL_DLLPUBLIC OUString FindFirstURLInText(OUString const & 
rText,
                                           INetURLObject::EncodeMechanism 
eMechanism = INetURLObject::EncodeMechanism::WasEncoded,
                                           rtl_TextEncoding eCharset = 
RTL_TEXTENCODING_UTF8);
 
-SVL_DLLPUBLIC OUString FindFirstDOIInText(OUString const & rText,
+SVL_DLLPUBLIC OUString FindFirstDOIInText(std::u16string_view rText,
                                           sal_Int32 & rBegin,
                                           sal_Int32 & rEnd,
                                           CharClass const & rCharClass);
diff --git a/include/svtools/htmlout.hxx b/include/svtools/htmlout.hxx
index 6e053977d964..8509a8890eca 100644
--- a/include/svtools/htmlout.hxx
+++ b/include/svtools/htmlout.hxx
@@ -42,14 +42,14 @@ struct HTMLOutEvent
 
 struct HTMLOutFuncs
 {
-    SVT_DLLPUBLIC static OString ConvertStringToHTML( const OUString& sSrc,
+    SVT_DLLPUBLIC static OString ConvertStringToHTML( std::u16string_view sSrc,
                         OUString *pNonConvertableChars = nullptr );
 
     SVT_DLLPUBLIC static SvStream& Out_AsciiTag( SvStream&, std::string_view 
rStr,
                                    bool bOn = true);
     SVT_DLLPUBLIC static SvStream& Out_Char( SvStream&, sal_uInt32 cChar,
                         OUString *pNonConvertableChars = nullptr );
-    SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, const OUString&,
+    SVT_DLLPUBLIC static SvStream& Out_String( SvStream&, std::u16string_view,
                         OUString *pNonConvertableChars = nullptr );
     SVT_DLLPUBLIC static SvStream& Out_Hex( SvStream&, sal_uInt32 nHex, 
sal_uInt8 nLen );
     SVT_DLLPUBLIC static SvStream& Out_Color( SvStream&, const Color&, bool 
bXHTML = false );
@@ -64,7 +64,7 @@ struct HTMLOutFuncs
     SVT_DLLPUBLIC static SvStream& OutScript( SvStream& rStrm,
                                 const OUString& rBaseURL,
                                 std::u16string_view rSource,
-                                const OUString& rLanguage,
+                                std::u16string_view rLanguage,
                                 ScriptType eScriptType,
                                 const OUString& rSrc,
                                 const OUString *pSBLibrary,
diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx
index 801eb80c7bf5..c041ce2d16d7 100644
--- a/include/test/screenshot_test.hxx
+++ b/include/test/screenshot_test.hxx
@@ -38,7 +38,7 @@ private:
 
 private:
     /// helpers
-    void implSaveScreenshot(const BitmapEx& rScreenshot, const OUString& 
rScreenshotId);
+    void implSaveScreenshot(const BitmapEx& rScreenshot, std::u16string_view 
rScreenshotId);
     void saveScreenshot(VclAbstractDialog const& rDialog);
     void saveScreenshot(weld::Window& rDialog);
 
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 0e74420e398f..be10c0569a9e 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -32,6 +32,7 @@
 #include <osl/process.h>
 #endif
 #include <osl/thread.hxx>
+#include <o3tl/string_view.hxx>
 #include <jvmfwk/framework.hxx>
 #include <vendorbase.hxx>
 #include <vendorplugin.hxx>
@@ -133,31 +134,36 @@ javaFrameworkError 
jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
     }
 }
 
-std::vector<OUString> jfw_convertUserPathList(OUString const& sUserPath)
+std::vector<OUString> jfw_convertUserPathList(std::u16string_view sUserPath)
 {
     std::vector<OUString> result;
     sal_Int32 nIdx = 0;
     do
     {
-        sal_Int32 nextColon = sUserPath.indexOf(SAL_PATHSEPARATOR, nIdx);
-        OUString sToken(sUserPath.subView(nIdx, nextColon > 0 ? nextColon - 
nIdx
-                                                              : 
sUserPath.getLength() - nIdx));
+        size_t nextColon = sUserPath.find(SAL_PATHSEPARATOR, nIdx);
+        std::u16string_view sToken;
+        if (nextColon != 0 && nextColon != std::u16string_view::npos)
+            sToken = sUserPath.substr(nIdx, nextColon - nIdx);
+        else
+            sToken = sUserPath.substr(nIdx, sUserPath.size() - nIdx);
 
         // Check if we are in bootstrap variable mode (class path starts with 
'$').
         // Then the class path must be in URL format.
-        if (sToken.startsWith("$"))
+        if (o3tl::starts_with(sToken, u"$"))
         {
             // Detect open bootstrap variables - they might contain colons - 
we need to skip those.
-            sal_Int32 nBootstrapVarStart = sToken.indexOf("${");
-            if (nBootstrapVarStart >= 0)
+            size_t nBootstrapVarStart = sToken.find(u"${");
+            if (nBootstrapVarStart != std::u16string_view::npos)
             {
-                sal_Int32 nBootstrapVarEnd = sToken.indexOf("}", 
nBootstrapVarStart);
-                if (nBootstrapVarEnd == -1)
+                size_t nBootstrapVarEnd = sToken.find(u"}", 
nBootstrapVarStart);
+                if (nBootstrapVarEnd == std::u16string_view::npos)
                 {
                     // Current colon is part of bootstrap variable - skip it!
-                    nextColon = sUserPath.indexOf(SAL_PATHSEPARATOR, nextColon 
+ 1);
-                    sToken = sUserPath.subView(nIdx, nextColon > 0 ? nextColon 
- nIdx
-                                                                   : 
sUserPath.getLength() - nIdx);
+                    nextColon = sUserPath.find(SAL_PATHSEPARATOR, nextColon + 
1);
+                    if (nextColon != 0 && nextColon != 
std::u16string_view::npos)
+                        sToken = sUserPath.substr(nIdx, nextColon - nIdx);
+                    else
+                        sToken = sUserPath.substr(nIdx, sUserPath.size() - 
nIdx);
                 }
             }
         }
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index f80a849116eb..aa27ae3fba2e 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -46,6 +46,7 @@
 
 #include <linguistic/misc.hxx>
 #include <linguistic/hyphdta.hxx>
+#include <o3tl/string_view.hxx>
 
 using namespace osl;
 using namespace com::sun::star;
diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 4413d668b428..6b55d066f727 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -50,6 +50,7 @@
 #include <stdio.h>
 #include <osl/diagnose.h>
 #include <o3tl/unit_conversion.hxx>
+#include <o3tl/string_view.hxx>
 
 #include <htmlexp.hxx>
 #include <global.hxx>
@@ -378,7 +379,7 @@ void ScHTMLExport::WriteHeader()
         for(sal_Int32 nPos {0};;)
         {
             rStrm.WriteChar( '\"' );
-            OUT_STR( rList.getToken( 0, ';', nPos ) );
+            OUT_STR( o3tl::getToken( rList, 0, ';', nPos ) );
             rStrm.WriteChar( '\"' );
             if (nPos<0)
                 break;
@@ -896,7 +897,7 @@ void ScHTMLExport::WriteTables()
         }
 
         if ( bAll )
-            OUT_COMMENT( 
"**************************************************************************" );
+            OUT_COMMENT( 
u"**************************************************************************" );
     }
 }
 
@@ -1250,7 +1251,7 @@ void ScHTMLExport::WriteCell( sc::ColumnBlockPosition& 
rBlockPos, SCCOL nCol, SC
                 for (sal_Int32 nPos {0};;)
                 {
                     OString aTmpStr = HTMLOutFuncs::ConvertStringToHTML(
-                        rList.getToken( 0, ';', nPos ),
+                        o3tl::getToken( rList, 0, ';', nPos ),
                         &aNonConvertibleChars);
                     aStr.append(aTmpStr);
                     if (nPos<0)
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index f81e510fdae7..869dde5ca95b 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -833,7 +833,7 @@ void ScCsvGrid::ImplSetTextLineSep(
     InvalidateGfx();
 }
 
-void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, const OUString& rTextLine 
)
+void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, std::u16string_view 
rTextLine )
 {
     if( nLine < GetFirstVisLine() ) return;
 
@@ -848,7 +848,7 @@ void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, const 
OUString& rTextLine )
     std::vector<OUString>& rStrVec = maTexts[ nLineIx ];
     rStrVec.clear();
     sal_uInt32 nColCount = GetColumnCount();
-    sal_Int32 nStrLen = rTextLine.getLength();
+    sal_Int32 nStrLen = rTextLine.size();
     sal_Int32 nStrIx = 0;
     for( sal_uInt32 nColIx = 0; (nColIx < nColCount) && (nStrIx < nStrLen); 
++nColIx )
     {
@@ -856,7 +856,7 @@ void ScCsvGrid::ImplSetTextLineFix( sal_Int32 nLine, const 
OUString& rTextLine )
         sal_Int32 nLastIx = nStrIx;
         ScImportExport::CountVisualWidth( rTextLine, nLastIx, nColWidth );
         sal_Int32 nLen = std::min( CSV_MAXSTRLEN, nLastIx - nStrIx );
-        rStrVec.push_back( rTextLine.copy( nStrIx, nLen ) );
+        rStrVec.push_back( OUString(rTextLine.substr( nStrIx, nLen )) );
         nStrIx = nStrIx + nLen;
     }
     InvalidateGfx();
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 2f587c58c533..6606f3479dcb 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -495,12 +495,12 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const 
OUString& rBaseURL, So
 
 // tdf#104927
 // http://www.unicode.org/reports/tr11/
-sal_Int32 ScImportExport::CountVisualWidth(const OUString& rStr, sal_Int32& 
nIdx, sal_Int32 nMaxWidth)
+sal_Int32 ScImportExport::CountVisualWidth(std::u16string_view rStr, 
sal_Int32& nIdx, sal_Int32 nMaxWidth)
 {
     sal_Int32 nWidth = 0;
-    while(nIdx < rStr.getLength() && nWidth < nMaxWidth)
+    while(nIdx < static_cast<sal_Int32>(rStr.size()) && nWidth < nMaxWidth)
     {
-        sal_uInt32 nCode = rStr.iterateCodePoints(&nIdx);
+        sal_uInt32 nCode = o3tl::iterateCodePoints(rStr, &nIdx);
 
         auto nEaWidth = u_getIntPropertyValue(nCode, UCHAR_EAST_ASIAN_WIDTH);
         if (nEaWidth == U_EA_FULLWIDTH || nEaWidth == U_EA_WIDE)
@@ -509,10 +509,10 @@ sal_Int32 ScImportExport::CountVisualWidth(const 
OUString& rStr, sal_Int32& nIdx
             nWidth += 1;
     }
 
-    if (nIdx < rStr.getLength())
+    if (nIdx < static_cast<sal_Int32>(rStr.size()))
     {
         sal_Int32 nTmpIdx = nIdx;
-        sal_uInt32 nCode = rStr.iterateCodePoints(&nTmpIdx);
+        sal_uInt32 nCode = o3tl::iterateCodePoints(rStr, &nTmpIdx);
 
         if (u_getIntPropertyValue(nCode, UCHAR_DEFAULT_IGNORABLE_CODE_POINT))
             nIdx = nTmpIdx;
@@ -520,7 +520,7 @@ sal_Int32 ScImportExport::CountVisualWidth(const OUString& 
rStr, sal_Int32& nIdx
     return nWidth;
 }
 
-sal_Int32 ScImportExport::CountVisualWidth(const OUString& rStr)
+sal_Int32 ScImportExport::CountVisualWidth(std::u16string_view rStr)
 {
     sal_Int32 nIdx = 0;
     return CountVisualWidth(rStr, nIdx, SAL_MAX_INT32);
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index c83df6c8b64e..683070b04eb7 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -237,7 +237,7 @@ public:
                                     sal_Int32 nLine, const OUString& rTextLine,
                                     const OUString& rSepChars, sal_Unicode 
cTextSep, bool bMergeSep, bool bRemoveSpace = false );
     /** Fills all cells of a line with the passed text (fixed width mode). */
-    void                        ImplSetTextLineFix( sal_Int32 nLine, const 
OUString& rTextLine );
+    void                        ImplSetTextLineFix( sal_Int32 nLine, 
std::u16string_view rTextLine );
 
     /** Returns the text of the specified cell. */
     OUString             GetCellText( sal_uInt32 nColIndex, sal_Int32 nLine ) 
const;
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 200997d206d6..827fd7f73fc6 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -118,12 +118,12 @@ public:
         @param nMaxWidth the maximum width to count.
         @return the sum of the width of counted characters.
     **/
-    static sal_Int32 CountVisualWidth(const OUString& rStr, sal_Int32& nIdx, 
sal_Int32 nMaxWidth);
+    static sal_Int32 CountVisualWidth(std::u16string_view rStr, sal_Int32& 
nIdx, sal_Int32 nMaxWidth);
 
     /** ScImportExport::CountVisualWidth
         @return the sum of the visual width of the whole string.
     **/
-    static sal_Int32 CountVisualWidth(const OUString& rStr);
+    static sal_Int32 CountVisualWidth(std::u16string_view rStr);
 
     //! only if stream is only used in own (!) memory
     static  void    SetNoEndianSwap( SvStream& rStrm );
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index fc3d00d14c66..07126c6c59bf 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -374,7 +374,7 @@ OUString TextAttribToHTMLString( SfxItemSet const * pSet, 
HtmlState* pState )
 }
 
 // escapes a string for html
-OUString StringToHTMLString( const OUString& rString )
+OUString StringToHTMLString( std::u16string_view rString )
 {
     SvMemoryStream aMemStm;
     HTMLOutFuncs::Out_String( aMemStm, rString );
diff --git a/sdext/source/pdfimport/inc/pdfiprocessor.hxx 
b/sdext/source/pdfimport/inc/pdfiprocessor.hxx
index 89a09d1780bf..11b7761d1738 100644
--- a/sdext/source/pdfimport/inc/pdfiprocessor.hxx
+++ b/sdext/source/pdfimport/inc/pdfiprocessor.hxx
@@ -81,7 +81,7 @@ namespace pdfi
 
         static void sortElements( Element* pElement );
 
-        static OUString SubstituteBidiMirrored(const OUString& rString);
+        static OUString SubstituteBidiMirrored(std::u16string_view rString);
 
     private:
         void processGlyphLine();
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx 
b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 2483144250b8..d60431dbce09 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -36,6 +36,7 @@
 #include <basegfx/utils/canvastools.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <i18nutil/unicode.hxx>
+#include <o3tl/string_view.hxx>
 
 using namespace com::sun::star;
 
@@ -763,13 +764,13 @@ void PDFIProcessor::sortElements(Element* pEle)
 /* Produce mirrored-image for each code point which has the Bidi_Mirrored 
property, within a string.
    This need to be done in forward order.
 */
-OUString PDFIProcessor::SubstituteBidiMirrored(const OUString& rString)
+OUString PDFIProcessor::SubstituteBidiMirrored(std::u16string_view rString)
 {
-    const sal_Int32 nLen = rString.getLength();
+    const sal_Int32 nLen = rString.size();
     OUStringBuffer aMirror(nLen);
 
     for (sal_Int32 i = 0; i < nLen;) {
-        const sal_uInt32 nCodePoint = rString.iterateCodePoints(&i);
+        const sal_uInt32 nCodePoint = o3tl::iterateCodePoints(rString, &i);
         aMirror.appendUtf32(unicode::GetMirroredChar(nCodePoint));
     }
     return aMirror.makeStringAndClear();
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index cbfd142856ea..58c3d9e1e844 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -50,8 +50,8 @@ char const sHTML_SC_no[] =       "NO";
 
 void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
                                   const char *pIndent,
-                                  const OUString& rName,
-                                  const OUString& rContent,
+                                  std::u16string_view rName,
+                                  std::u16string_view rContent,
                                   bool bHTTPEquiv,
                                   OUString *pNonConvertableChars  )
 {
@@ -79,7 +79,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const 
OUString& rBaseURL,
         const char *pIndent,
         OUString *pNonConvertableChars    )
 {
-    OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, 
"text/html; charset=utf-8", true,
+    OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, 
u"text/html; charset=utf-8", true,
                  pNonConvertableChars );
 
     // Title (regardless if empty)
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx 
b/stoc/source/uriproc/UriReferenceFactory.cxx
index 257391771340..c9bc16bad495 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -167,10 +167,10 @@ private:
 };
 
 css::uno::Reference< css::uri::XUriReference > parseGeneric(
-    OUString const & scheme, OUString const & schemeSpecificPart)
+    OUString const & scheme, std::u16string_view schemeSpecificPart)
 {
-    sal_Int32 len = schemeSpecificPart.getLength();
-    sal_Int32 i = 0;
+    size_t len = schemeSpecificPart.size();
+    size_t i = 0;
     bool hasAuthority = false;
     OUString authority;
     if (len - i >= 2 && schemeSpecificPart[i] == '/'
@@ -183,19 +183,19 @@ css::uno::Reference< css::uri::XUriReference > 
parseGeneric(
             ++i;
         }
         hasAuthority = true;
-        authority = schemeSpecificPart.copy(n, i - n);
+        authority = schemeSpecificPart.substr(n, i - n);
     }
     sal_Int32 n = i;
-    i = schemeSpecificPart.indexOf('?', i);
-    if (i == -1) {
+    i = schemeSpecificPart.find('?', i);
+    if (i == std::u16string_view::npos) {
         i = len;
     }
-    OUString path = schemeSpecificPart.copy(n, i - n);
+    OUString path( schemeSpecificPart.substr(n, i - n) );
     bool hasQuery = false;
     OUString query;
     if (i != len) {
         hasQuery = true;
-        query = schemeSpecificPart.copy(i + 1);
+        query = schemeSpecificPart.substr(i + 1);
     }
     return new UriReference(
         scheme, hasAuthority, authority, path, hasQuery, query);
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 6488edb5bb6d..71ab02491f55 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -745,17 +745,17 @@ OUString URIHelper::FindFirstURLInText(OUString const & 
rText,
     return OUString();
 }
 
-OUString URIHelper::FindFirstDOIInText(OUString const & rText,
+OUString URIHelper::FindFirstDOIInText(std::u16string_view rText,
                                        sal_Int32 & rBegin,
                                        sal_Int32 & rEnd,
                                        CharClass const & rCharClass)
 {
-    if (rBegin > rEnd || rEnd > rText.getLength())
+    if (rBegin > rEnd || rEnd > static_cast<sal_Int32>(rText.size()))
         return OUString();
 
     sal_Int32 start = 7;
     sal_Int32 count = rEnd-rBegin;
-    OUString candidate(rText.subView(rBegin, count));
+    OUString candidate(rText.substr(rBegin, count));
     // Match with regex "doi:10\.\d{4,9}\/[-._;()\/:a-zA-Z0-9]+"
     if (candidate.startsWithIgnoreAsciiCase("doi:10."))
     {
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 11071b5caa17..b2d7c279fc53 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -725,10 +725,10 @@ bool NatNumTakesParameters(sal_Int16 nNum)
 
 // is there a 3-letter bank code in NatNum12 param (but not
 // followed by an equal mark, like in the date code "NNN=")?
-static bool lcl_isNatNum12Currency( const OUString& sParam )
+static bool lcl_isNatNum12Currency( std::u16string_view sParam )
 {
     sal_Int32 nUpper = 0;
-    sal_Int32 nLen = sParam.getLength();
+    sal_Int32 nLen = sParam.size();
     for (sal_Int32 n = 0; n < nLen; ++n)
     {
         sal_Unicode c = sParam[n];
diff --git a/svtools/source/svhtml/htmlout.cxx 
b/svtools/source/svhtml/htmlout.cxx
index 4f027b0c10de..5dd6b099ec9f 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -34,6 +34,7 @@
 #include <svl/urihelper.hxx>
 #include <rtl/character.hxx>
 #include <tools/debug.hxx>
+#include <o3tl/string_view.hxx>
 
 #include <sstream>
 
@@ -495,13 +496,13 @@ static OString lcl_FlushToAscii()
     return aDest.makeStringAndClear();
 }
 
-OString HTMLOutFuncs::ConvertStringToHTML( const OUString& rSrc,
+OString HTMLOutFuncs::ConvertStringToHTML( std::u16string_view rSrc,
     OUString *pNonConvertableChars )
 {
     OStringBuffer aDest;
-    for( sal_Int32 i=0, nLen = rSrc.getLength(); i < nLen; )
+    for( sal_Int32 i=0, nLen = rSrc.size(); i < nLen; )
         aDest.append(lcl_ConvertCharToHTML(
-            rSrc.iterateCodePoints(&i), pNonConvertableChars));
+            o3tl::iterateCodePoints(rSrc, &i), pNonConvertableChars));
     aDest.append(lcl_FlushToAscii());
     return aDest.makeStringAndClear();
 }
@@ -527,12 +528,12 @@ SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, 
sal_uInt32 c,
     return rStream;
 }
 
-SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const OUString& rOUStr,
+SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, std::u16string_view 
rOUStr,
                                     OUString *pNonConvertableChars )
 {
-    sal_Int32 nLen = rOUStr.getLength();
+    sal_Int32 nLen = rOUStr.size();
     for( sal_Int32 n = 0; n < nLen; )
-        HTMLOutFuncs::Out_Char( rStream, rOUStr.iterateCodePoints(&n),
+        HTMLOutFuncs::Out_Char( rStream, o3tl::iterateCodePoints(rOUStr, &n),
                                 pNonConvertableChars );
     HTMLOutFuncs::FlushToAscii( rStream );
     return rStream;
@@ -773,7 +774,7 @@ SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
 SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
                                    const OUString& rBaseURL,
                                    std::u16string_view rSource,
-                                   const OUString& rLanguage,
+                                   std::u16string_view rLanguage,
                                    ScriptType eScriptType,
                                    const OUString& rSrc,
                                    const OUString *pSBLibrary,
@@ -782,7 +783,7 @@ SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm,
     // script is not indented!
     OStringBuffer sOut("<" OOO_STRING_SVTOOLS_HTML_script);
 
-    if( !rLanguage.isEmpty() )
+    if( !rLanguage.empty() )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_language "=\"");
         rStrm.WriteOString( sOut );
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx 
b/sw/source/core/doc/SwStyleNameMapper.cxx
index 17f732d6d31e..a42a274b0526 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -23,6 +23,7 @@
 #include <swtypes.hxx>
 #include <unotools/syslocale.hxx>
 #include <i18nlangtag/languagetag.hxx>
+#include <o3tl/string_view.hxx>
 #include <map>
 
 #ifdef _NEED_TO_DEBUG_MAPPING
@@ -60,11 +61,11 @@ lcl_GetSpecialExtraName(const OUString& rExtraName, const 
bool bIsUIName )
     return rExtraName;
 }
 
-bool lcl_SuffixIsUser(const OUString & rString)
+bool lcl_SuffixIsUser(std::u16string_view rString)
 {
     // Interesting, why the rest must be longer than 1 character? It is so
     // since commit 4fbc9dd48b7cebb304010e7337b1bbc3936c7923 (2001-08-16)
-    return rString.getLength() > 8 && rString.endsWith(" (user)");
+    return rString.size() > 8 && o3tl::ends_with(rString, u" (user)");
 }
 
 void lcl_CheckSuffixAndDelete(OUString & rString)
diff --git a/sw/source/filter/html/htmldrawwriter.cxx 
b/sw/source/filter/html/htmldrawwriter.cxx
index 7036b99b3aa6..0ef2d2514a22 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -259,7 +259,7 @@ SwHTMLWriter& OutHTML_DrawFrameFormatAsMarquee( 
SwHTMLWriter& rWrt,
     HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_MARQUEE;
     if( rWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) )
         nFrameFlags |= HTML_FRMOPTS_MARQUEE_CSS1;
-    OString aEndTags = rWrt.OutFrameFormatOptions(rFormat, OUString(), 
nFrameFlags);
+    OString aEndTags = rWrt.OutFrameFormatOptions(rFormat, u"", nFrameFlags);
     if( rWrt.IsHTMLMode( HTMLMODE_ABS_POS_DRAW ) )
         rWrt.OutCSS1_FrameFormatOptions( rFormat, nFrameFlags, &rSdrObject );
 
diff --git a/sw/source/filter/html/htmlfldw.cxx 
b/sw/source/filter/html/htmlfldw.cxx
index e8d38608b42c..65f0d7167d2a 100644
--- a/sw/source/filter/html/htmlfldw.cxx
+++ b/sw/source/filter/html/htmlfldw.cxx
@@ -414,7 +414,7 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, 
const SwField* pField,
                     }
                 }
 
-                HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, 
nChunkLen ) );
+                HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.subView( nPos, 
nChunkLen ) );
 
                 rWrt.m_bTagOn = false;
                 while( nItems )
@@ -423,7 +423,7 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, 
const SwField* pField,
             }
             else
             {
-                HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.copy( nPos, 
nChunkLen ) );
+                HTMLOutFuncs::Out_String( rWrt.Strm(), sExpand.subView( nPos, 
nChunkLen ) );
             }
             nPos = nEndPos;
         }
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 90b59d4c090b..ea421f3cbc72 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -505,7 +505,7 @@ void SwHTMLWriter::OutFrameFormat( AllHtmlFlags nMode, 
const SwFrameFormat& rFra
 }
 
 OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
-                                     const OUString& rAlternateText,
+                                     std::u16string_view rAlternateText,
                                      HtmlFrmOpts nFrameOpts )
 {
     OString sRetEndTags;
@@ -535,7 +535,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const 
SwFrameFormat &rFrameFormat,
     }
 
     // ALT
-    if( (nFrameOpts & HtmlFrmOpts::Alt) && !rAlternateText.isEmpty() )
+    if( (nFrameOpts & HtmlFrmOpts::Alt) && !rAlternateText.empty() )
     {
         sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_alt "=\"");
         Strm().WriteOString( sOut );
@@ -1631,7 +1631,7 @@ static SwHTMLWriter & OutHTML_FrameFormatAsMulticol( 
SwHTMLWriter& rWrt,
     HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_MULTICOL;
     if( rWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr )
         nFrameFlags |= HTML_FRMOPTS_MULTICOL_CSS1;
-    rWrt.OutFrameFormatOptions(rFrameFormat, OUString(), nFrameFlags);
+    rWrt.OutFrameFormatOptions(rFrameFormat, u"", nFrameFlags);
     if( rWrt.IsHTMLMode( HTMLMODE_ABS_POS_FLY ) && !bInCntnr )
         rWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags );
 
@@ -1677,7 +1677,7 @@ static SwHTMLWriter& OutHTML_FrameFormatAsSpacer( 
SwHTMLWriter& rWrt, const SwFr
     rWrt.Strm().WriteOString( sOut );
 
     // ALIGN, WIDTH, HEIGHT
-    OString aEndTags = rWrt.OutFrameFormatOptions(rFrameFormat, OUString(), 
HTML_FRMOPTS_SPACER);
+    OString aEndTags = rWrt.OutFrameFormatOptions(rFrameFormat, u"", 
HTML_FRMOPTS_SPACER);
 
     rWrt.Strm().WriteChar( '>' );
     if( !aEndTags.isEmpty() )
@@ -1712,7 +1712,7 @@ static SwHTMLWriter& OutHTML_FrameFormatAsDivOrSpan( 
SwHTMLWriter& rWrt,
     HtmlFrmOpts nFrameFlags = HTML_FRMOPTS_DIV;
     if( rWrt.IsHTMLMode( HTMLMODE_BORDER_NONE ) )
        nFrameFlags |= HtmlFrmOpts::SNoBorder;
-    OString aEndTags = rWrt.OutFrameFormatOptions(rFrameFormat, OUString(), 
nFrameFlags);
+    OString aEndTags = rWrt.OutFrameFormatOptions(rFrameFormat, u"", 
nFrameFlags);
     rWrt.OutCSS1_FrameFormatOptions( rFrameFormat, nFrameFlags );
     rWrt.Strm().WriteChar( '>' );
 
diff --git a/sw/source/filter/html/htmlforw.cxx 
b/sw/source/filter/html/htmlforw.cxx
index 98423fc96a3e..6416dfc93cd7 100644
--- a/sw/source/filter/html/htmlforw.cxx
+++ b/sw/source/filter/html/htmlforw.cxx
@@ -1015,7 +1015,7 @@ SwHTMLWriter& OutHTML_DrawFrameFormatAsControl( 
SwHTMLWriter& rWrt,
     }
     OString aEndTags;
     if( nFrameOpts != HtmlFrmOpts::NONE )
-        aEndTags = rWrt.OutFrameFormatOptions(rFormat, OUString(), nFrameOpts);
+        aEndTags = rWrt.OutFrameFormatOptions(rFormat, u"", nFrameOpts);
 
     if( rWrt.m_bCfgOutStyles )
     {
diff --git a/sw/source/filter/html/htmlftn.cxx 
b/sw/source/filter/html/htmlftn.cxx
index d3c8bbc76ae4..74916af9c705 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -426,7 +426,7 @@ OUString SwHTMLWriter::GetFootEndNoteSym( const 
SwFormatFootnote& rFormatFootnot
 }
 
 void SwHTMLWriter::OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote,
-                                         const OUString& rNum,
+                                         std::u16string_view rNum,
                                          sal_uInt16 nScript )
 {
     const SwEndNoteInfo *pInfo;
diff --git a/sw/source/filter/html/wrthtml.hxx 
b/sw/source/filter/html/wrthtml.hxx
index 9b0d145cad86..aac06fbf8868 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -474,7 +474,7 @@ public:
     void OutFootEndNoteInfo();
     void OutFootEndNotes();
     OUString GetFootEndNoteSym( const SwFormatFootnote& rFormatFootnote );
-    void OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote, const 
OUString& rNum,
+    void OutFootEndNoteSym( const SwFormatFootnote& rFormatFootnote, 
std::u16string_view rNum,
                              sal_uInt16 nScript );
 
     void OutBasic(const SwHTMLWriter& rHTMLWrt);
@@ -509,7 +509,7 @@ public:
     // ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE option of current
     // frame format output and maybe add a <BR CLEAR=...> at the
     // beginning of rEndTags
-    OString OutFrameFormatOptions( const SwFrameFormat& rFrameFormat, const 
OUString& rAltText,
+    OString OutFrameFormatOptions( const SwFrameFormat& rFrameFormat, 
std::u16string_view rAltText,
                                    HtmlFrmOpts nFrameOpts );
 
     void writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameFormat& 
rFrameFormat, const OUString& rAltText, HtmlFrmOpts nFrameOpts);
diff --git a/test/source/screenshot_test.cxx b/test/source/screenshot_test.cxx
index b4c188fdbc34..9b85338303a0 100644
--- a/test/source/screenshot_test.cxx
+++ b/test/source/screenshot_test.cxx
@@ -24,15 +24,23 @@
 
 
 namespace {
-    void splitHelpId( const OUString& rHelpId, OUString& rDirname, OUString 
&rBasename )
+    void splitHelpId( std::u16string_view rHelpId, std::u16string_view& 
rDirname, std::u16string_view& rBasename )
     {
-        sal_Int32 nIndex = rHelpId.lastIndexOf( '/' );
+        size_t nIndex = rHelpId.rfind( '/' );
 
-        if( nIndex > 0 )
-            rDirname = rHelpId.subView( 0, nIndex );
+        if( nIndex != 0 && nIndex != std::u16string_view::npos)
+            rDirname = rHelpId.substr( 0, nIndex );
 
-        if( rHelpId.getLength() > nIndex+1 )
-            rBasename = rHelpId.subView( nIndex+1 );
+        if (nIndex == std::u16string_view::npos)
+        {
+            if( rHelpId.size() > 0 )
+                rBasename = rHelpId;
+        }
+        else
+        {
+            if( rHelpId.size() > nIndex+1 )
+                rBasename = rHelpId.substr( nIndex+1 );
+        }
     }
 }
 
@@ -71,11 +79,11 @@ void ScreenshotTest::setUp()
     }
 }
 
-void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, const 
OUString& rScreenshotId)
+void ScreenshotTest::implSaveScreenshot(const BitmapEx& rScreenshot, 
std::u16string_view rScreenshotId)
 {
-    OUString aDirname, aBasename;
-    splitHelpId(rScreenshotId, aDirname, aBasename);
-    aDirname = g_aScreenshotDirectory + "/" + aDirname +
+    std::u16string_view aSplitDirname, aBasename;
+    splitHelpId(rScreenshotId, aSplitDirname, aBasename);
+    OUString aDirname = g_aScreenshotDirectory + "/" + aSplitDirname +
                ( (maCurrentLanguage == "en-US") ? OUString() : "/" + 
maCurrentLanguage );
 
     auto const dirUrl = m_directories.getURLFromWorkdir(aDirname);
diff --git a/ucbhelper/source/client/proxydecider.cxx 
b/ucbhelper/source/client/proxydecider.cxx
index 8acc15716af4..6313937ab19d 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -155,7 +155,7 @@ public:
     virtual void SAL_CALL disposing( const lang::EventObject& Source ) 
override;
 
 private:
-    void setNoProxyList( const OUString & rNoProxyList );
+    void setNoProxyList( std::u16string_view rNoProxyList );
 };
 
 
@@ -777,28 +777,28 @@ void SAL_CALL InternetProxyDecider_Impl::disposing(const 
lang::EventObject&)
 
 
 void InternetProxyDecider_Impl::setNoProxyList(
-                                        const OUString & rNoProxyList )
+                                        std::u16string_view rNoProxyList )
 {
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
     m_aNoProxyList.clear();
 
-    if ( rNoProxyList.isEmpty() )
+    if ( rNoProxyList.empty() )
         return;
 
     // List of connection endpoints hostname[:port],
     // separated by semicolon. Wildcards allowed.
 
-    sal_Int32 nPos = 0;
-    sal_Int32 nEnd = rNoProxyList.indexOf( ';' );
-    sal_Int32 nLen = rNoProxyList.getLength();
+    size_t nPos = 0;
+    size_t nEnd = rNoProxyList.find( ';' );
+    size_t nLen = rNoProxyList.size();
 
     do
     {
-        if ( nEnd == -1 )
+        if ( nEnd == std::u16string_view::npos )
             nEnd = nLen;
 
-        OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos );
+        OUString aToken( rNoProxyList.substr( nPos, nEnd - nPos ) );
 
         if ( !aToken.isEmpty() )
         {
@@ -870,7 +870,7 @@ void InternetProxyDecider_Impl::setNoProxyList(
         if ( nEnd != nLen )
         {
             nPos = nEnd + 1;
-            nEnd = rNoProxyList.indexOf( ';', nPos );
+            nEnd = rNoProxyList.find( ';', nPos );
         }
     }
     while ( nEnd != nLen );
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index a2ce50202b92..bce015ee4f73 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -314,7 +314,7 @@ public:
     // Helper method for input method handling: Calculate cursor index in 
(UTF-16) OUString,
     // starting at nCursorIndex, moving number of characters (not UTF-16 
codepoints) specified
     // in nOffset, nChars.
-    static Selection        CalcDeleteSurroundingSelection(const OUString& 
rSurroundingText,
+    static Selection        CalcDeleteSurroundingSelection(std::u16string_view 
rSurroundingText,
                                                            sal_Int32 
nCursorIndex, int nOffset, int nChars);
 };
 
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index 22349a8d2e9a..4204d4199f72 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -63,7 +63,7 @@ namespace vcl
         ~TextLayoutCommon() COVERITY_NOEXCEPT_FALSE;
 
     private:
-        OUString GetCenterEllipsisString(OUString const& rOrigStr, sal_Int32 
nIndex, tools::Long nMaxWidth);
+        OUString GetCenterEllipsisString(std::u16string_view rOrigStr, 
sal_Int32 nIndex, tools::Long nMaxWidth);
         OUString GetEndEllipsisString(OUString const& rOrigStr, sal_Int32 
nIndex, tools::Long nMaxWidth, bool bClipText);
         OUString GetNewsEllipsisString(OUString const& rOrigStr, tools::Long 
nMaxWidth, DrawTextFlags nStyle);
     };
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 2327b376b8ce..3aad490fae80 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -7571,7 +7571,7 @@ weld::Window* SalFrame::GetFrameWeld() const
     return m_xFrameWeld.get();
 }
 
-Selection SalFrame::CalcDeleteSurroundingSelection(const OUString& 
rSurroundingText,
+Selection SalFrame::CalcDeleteSurroundingSelection(std::u16string_view 
rSurroundingText,
                                                    sal_Int32 nCursorIndex, int 
nOffset, int nChars)
 {
     Selection aInvalid(SAL_MAX_UINT32, SAL_MAX_UINT32);
@@ -7581,9 +7581,9 @@ Selection SalFrame::CalcDeleteSurroundingSelection(const 
OUString& rSurroundingT
 
     if (nOffset > 0)
     {
-        while (nOffset && nCursorIndex < rSurroundingText.getLength())
+        while (nOffset && nCursorIndex < 
static_cast<sal_Int32>(rSurroundingText.size()))
         {
-            rSurroundingText.iterateCodePoints(&nCursorIndex, 1);
+            o3tl::iterateCodePoints(rSurroundingText, &nCursorIndex, 1);
             --nOffset;
         }
     }
@@ -7591,7 +7591,7 @@ Selection SalFrame::CalcDeleteSurroundingSelection(const 
OUString& rSurroundingT
     {
         while (nOffset && nCursorIndex > 0)
         {
-            rSurroundingText.iterateCodePoints(&nCursorIndex, -1);
+            o3tl::iterateCodePoints(rSurroundingText, &nCursorIndex, -1);
             ++nOffset;
         }
     }
@@ -7605,9 +7605,9 @@ Selection SalFrame::CalcDeleteSurroundingSelection(const 
OUString& rSurroundingT
 
     sal_Int32 nCursorEndIndex(nCursorIndex);
     sal_Int32 nCount(0);
-    while (nCount < nChars && nCursorEndIndex < rSurroundingText.getLength())
+    while (nCount < nChars && nCursorEndIndex < 
static_cast<sal_Int32>(rSurroundingText.size()))
     {
-        rSurroundingText.iterateCodePoints(&nCursorEndIndex, 1);
+        o3tl::iterateCodePoints(rSurroundingText, &nCursorEndIndex, 1);
         ++nCount;
     }
 
diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx
index d0c76c852f63..303ea5b28659 100644
--- a/vcl/source/text/textlayout.cxx
+++ b/vcl/source/text/textlayout.cxx
@@ -65,13 +65,13 @@ namespace vcl
     TextLayoutCommon::~TextLayoutCommon() COVERITY_NOEXCEPT_FALSE
     {}
 
-    OUString TextLayoutCommon::GetCenterEllipsisString(OUString const& 
rOrigStr, sal_Int32 nIndex, tools::Long nMaxWidth)
+    OUString TextLayoutCommon::GetCenterEllipsisString(std::u16string_view 
rOrigStr, sal_Int32 nIndex, tools::Long nMaxWidth)
     {
         OUStringBuffer aTmpStr(rOrigStr);
 
         // speed it up by removing all but 1.33x as many as the break pos.
-        sal_Int32 nEraseChars = std::max<sal_Int32>(4, rOrigStr.getLength() - 
(nIndex*4)/3);
-        while(nEraseChars < rOrigStr.getLength() && 
GetTextWidth(aTmpStr.toString(), 0, aTmpStr.getLength()) > nMaxWidth)
+        sal_Int32 nEraseChars = std::max<sal_Int32>(4, rOrigStr.size() - 
(nIndex*4)/3);
+        while(nEraseChars < static_cast<sal_Int32>(rOrigStr.size()) && 
GetTextWidth(aTmpStr.toString(), 0, aTmpStr.getLength()) > nMaxWidth)
         {
             aTmpStr = rOrigStr;
             sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2;

Reply via email to