diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-08 10:33:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-08 12:58:29 +0200 |
commit | 5d47604c0aecce28b058a01cd1324d87c154c616 (patch) | |
tree | 26593de80abd24ad17614527789ed67e3ff1754b /basctl | |
parent | 393c3930c8cedb2fcf380539c57d8da5cfb31572 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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)) |