[Libreoffice-commits] core.git: basctl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 8 10:59:01 UTC 2020


 basctl/source/basicide/baside2b.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5d47604c0aecce28b058a01cd1324d87c154c616
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Aug 8 10:33:05 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Aug 8 12:58:29 2020 +0200

    use std::string_view
    
    Change-Id: Iac8367a1ea3ec603b5db8b3dd8bdc7dd7265eb83
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100377
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 410555b95be1..e13656ee73a7 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -98,7 +98,7 @@ int const nScrollLine = 12;
 int const nScrollPage = 60;
 int const DWBORDER = 3;
 
-OUString const cSuffixes {"%&!#@$"};
+std::u16string_view const cSuffixes = u"%&!#@$";
 
 } // namespace
 
@@ -172,13 +172,13 @@ void lcl_SeparateNameAndIndex( const OUString& rVName, OUString& rVar, OUString&
     if ( !rVar.isEmpty() )
     {
         sal_uInt16 nLastChar = rVar.getLength()-1;
-        if ( cSuffixes.indexOf(rVar[ nLastChar ] ) >= 0 )
+        if ( cSuffixes.find(rVar[ nLastChar ] ) != std::u16string_view::npos )
             rVar = rVar.replaceAt( nLastChar, 1, "" );
     }
     if ( !rIndex.isEmpty() )
     {
         sal_uInt16 nLastChar = rIndex.getLength()-1;
-        if ( cSuffixes.indexOf(rIndex[ nLastChar ] ) >=0 )
+        if ( cSuffixes.find(rIndex[ nLastChar ] ) != std::u16string_view::npos )
             rIndex = rIndex.replaceAt( nLastChar, 1, "" );
     }
 }
@@ -369,7 +369,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt )
                 if ( !aWord.isEmpty() && !comphelper::string::isdigitAsciiString(aWord) )
                 {
                     sal_uInt16 nLastChar = aWord.getLength() - 1;
-                    if ( cSuffixes.indexOf(aWord[ nLastChar ] ) >= 0 )
+                    if ( cSuffixes.find(aWord[ nLastChar ] ) != std::u16string_view::npos )
                         aWord = aWord.replaceAt( nLastChar, 1, "" );
                     SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord );
                     if (SbxVariable const* pVar = IsSbxVariable(pSBX))


More information about the Libreoffice-commits mailing list