editeng/source/misc/svxacorr.cxx |    7 +++----
 include/editeng/svxacorr.hxx     |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit a65d470ad07888d902718ff68f8db00d14f72743
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon Sep 29 02:27:15 2025 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon Sep 29 07:06:42 2025 +0200

    Pass string view to FindInWordStartExceptList
    
    It uses the argument to pass to sorted_vector::find; and that can use
    the string view instead of OUString.
    
    Change-Id: I9c31aadae82a0dd1d28969ce073a6acc9e5729b5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191585
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins

diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 62a946e11776..59c34e6f9175 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -997,7 +997,7 @@ void SvxAutoCorrect::FnCapitalStartSentence( 
SvxAutoCorrDoc& rDoc,
     }
 
     // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
-    if (FindInWordStartExceptList(eLang, OUString(pWordStt, pDelim - 
pWordStt)))
+    if (FindInWordStartExceptList(eLang, std::u16string_view(pWordStt, 
pDelim)))
         return;
 
     if( bAtStart )  // at the beginning of a paragraph?
@@ -1212,7 +1212,7 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& 
rDoc, const OUString& rT
         return false;
 
     // No replacement for words in TWo INitial CApitals or sMALL iNITIAL list
-    if (FindInWordStartExceptList(eLang, rTxt.copy(nSttPos, nEndPos - 
nSttPos)))
+    if (FindInWordStartExceptList(eLang, rTxt.subView(nSttPos, nEndPos - 
nSttPos)))
         return false;
 
     OUStringBuffer aConverted(rCC.uppercase(rTxt, nSttPos, 1)
@@ -2111,8 +2111,7 @@ bool SvxAutoCorrect::SearchWordsNext(
     return pWordList->SearchWordsNext( rTxt, rStt, nEndPos, rStatus );
 }
 
-bool SvxAutoCorrect::FindInWordStartExceptList( LanguageType eLang,
-                                             const OUString& sWord )
+bool SvxAutoCorrect::FindInWordStartExceptList(LanguageType eLang, 
std::u16string_view sWord)
 {
     LanguageTag aLanguageTag( eLang);
 
diff --git a/include/editeng/svxacorr.hxx b/include/editeng/svxacorr.hxx
index f99df2a51612..89df7eb25765 100644
--- a/include/editeng/svxacorr.hxx
+++ b/include/editeng/svxacorr.hxx
@@ -451,7 +451,7 @@ public:
     bool AddWordStartException( const OUString& rNew, LanguageType eLang);
 
     // Search through the Languages for the entry
-    bool FindInWordStartExceptList( LanguageType eLang, const OUString& sWord 
);
+    bool FindInWordStartExceptList( LanguageType eLang, std::u16string_view 
sWord );
     bool FindInCplSttExceptList( LanguageType eLang, const OUString& sWord,
                                     bool bAbbreviation = false);
 

Reply via email to