diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-13 14:29:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-17 09:57:35 +0100 |
commit | 8ef6067596cf4b2c52fbce94b44bf7af9fefa643 (patch) | |
tree | f4cca1a99ba97683b14fa6fe0f1f45f75bf855c2 /basic | |
parent | 75bada928cf08d2afc6efe52ba99b45088bc9eec (diff) |
loplugin:stringviewparam check methods too
not just functions
Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/inc/sbxform.hxx | 2 | ||||
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/codecompletecache.cxx | 4 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxform.cxx | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/basic/inc/sbxform.hxx b/basic/inc/sbxform.hxx index 94dece69832c..8173c8ed87b7 100644 --- a/basic/inc/sbxform.hxx +++ b/basic/inc/sbxform.hxx @@ -103,7 +103,7 @@ class SbxBasicFormater { void LeftShiftDecimalPoint( OUStringBuffer& sStrg ); void StrRoundDigit( OUStringBuffer& sStrg, short nPos, bool& bOverflow ); void StrRoundDigit( OUStringBuffer& sStrg, short nPos ); - static void ParseBack( OUStringBuffer& sStrg, const OUString& sFormatStrg, + static void ParseBack( OUStringBuffer& sStrg, std::u16string_view sFormatStrg, short nFormatPos ); // Methods for string conversion with sprintf(): void InitScan( double _dNum ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index d1d4b86565b7..50ff14effade 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -126,7 +126,7 @@ public: static void insertLibraryImpl( const uno::Reference< script::XLibraryContainer >& xScriptCont, BasicManager* pMgr, const uno::Any& aLibAny, const OUString& aLibName ); static void addLibraryModulesImpl( BasicManager const * pMgr, const uno::Reference< container::XNameAccess >& xLibNameAccess, - const OUString& aLibName ); + std::u16string_view aLibName ); // XEventListener @@ -172,7 +172,7 @@ void BasMgrContainerListenerImpl::insertLibraryImpl( const uno::Reference< scrip void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager const * pMgr, - const uno::Reference< container::XNameAccess >& xLibNameAccess, const OUString& aLibName ) + const uno::Reference< container::XNameAccess >& xLibNameAccess, std::u16string_view aLibName ) { uno::Sequence< OUString > aModuleNames = xLibNameAccess->getElementNames(); sal_Int32 nModuleCount = aModuleNames.getLength(); @@ -823,7 +823,7 @@ BasicManager::~BasicManager() Broadcast( SfxHint( SfxHintId::Dying) ); } -bool BasicManager::HasExeCode( const OUString& sLib ) +bool BasicManager::HasExeCode( std::u16string_view sLib ) { StarBASIC* pLib = GetLib(sLib); if ( pLib ) @@ -1199,7 +1199,7 @@ StarBASIC* BasicManager::GetStdLib() const return pLib; } -StarBASIC* BasicManager::GetLib( const OUString& rName ) const +StarBASIC* BasicManager::GetLib( std::u16string_view rName ) const { for (auto const& rpLib : mpImpl->aLibs) { @@ -1211,7 +1211,7 @@ StarBASIC* BasicManager::GetLib( const OUString& rName ) const return nullptr; } -sal_uInt16 BasicManager::GetLibId( const OUString& rName ) const +sal_uInt16 BasicManager::GetLibId( std::u16string_view rName ) const { for (size_t i = 0; i < mpImpl->aLibs.size(); i++) { @@ -1223,7 +1223,7 @@ sal_uInt16 BasicManager::GetLibId( const OUString& rName ) const return LIB_NOTFOUND; } -bool BasicManager::HasLib( const OUString& rName ) const +bool BasicManager::HasLib( std::u16string_view rName ) const { for (const auto& rpLib : mpImpl->aLibs) { diff --git a/basic/source/classes/codecompletecache.cxx b/basic/source/classes/codecompletecache.cxx index 4c0d3523a86e..e2993c28581a 100644 --- a/basic/source/classes/codecompletecache.cxx +++ b/basic/source/classes/codecompletecache.cxx @@ -147,7 +147,7 @@ void CodeCompleteDataCache::InsertLocalVar( const OUString& sProcName, const OUS } } -OUString CodeCompleteDataCache::GetVarType( const OUString& sVarName ) const +OUString CodeCompleteDataCache::GetVarType( std::u16string_view sVarName ) const { for (auto const& varScope : aVarScopes) { @@ -169,7 +169,7 @@ OUString CodeCompleteDataCache::GetVarType( const OUString& sVarName ) const return OUString(); //not found } -OUString CodeCompleteDataCache::GetCorrectCaseVarName( const OUString& sVarName, const OUString& sActProcName ) const +OUString CodeCompleteDataCache::GetCorrectCaseVarName( std::u16string_view sVarName, std::u16string_view sActProcName ) const { for (auto const& varScope : aVarScopes) { diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 6ae3692cc833..f8426f4e1a7f 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1086,7 +1086,7 @@ void StarBASIC::Clear() pModules.clear(); } -SbModule* StarBASIC::FindModule( const OUString& rName ) +SbModule* StarBASIC::FindModule( std::u16string_view rName ) { for (const auto& pModule: pModules) { diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index 85374facd545..052a2dcc159e 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -214,7 +214,7 @@ void SbxBasicFormater::StrRoundDigit( OUStringBuffer& sStrg, short nPos ) StrRoundDigit( sStrg, nPos, bOverflow ); } -void SbxBasicFormater::ParseBack( OUStringBuffer& sStrg, const OUString& sFormatStrg, +void SbxBasicFormater::ParseBack( OUStringBuffer& sStrg, std::u16string_view sFormatStrg, short nFormatPos ) { for( sal_Int32 i = nFormatPos; |