diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-25 08:14:07 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-30 12:32:14 +0100 |
commit | 8332d6d8200e8ca1f22dd98d9373efd5a431d09c (patch) | |
tree | dd45d452202998297b8562743ea6345462304d04 /basic | |
parent | d05a4cfbdcece491f7385dbeaa7eca03f2fdc1d5 (diff) |
loplugin:stringviewparam include comparisons with string literals
Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/inc/runtime.hxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr-none.cxx | 10 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr-x64.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr-x86.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/dllmgr.hxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index b98d986debce..3262dec7ce0d 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -284,7 +284,7 @@ class SbiRuntime void SetParameters( SbxArray* ); // HAS TO BE IMPLEMENTED SOME TIME - void DllCall( const OUString&, const OUString&, SbxArray*, SbxDataType, bool ); + void DllCall( std::u16string_view, std::u16string_view, SbxArray*, SbxDataType, bool ); // #56204 swap out DIM-functionality into help method (step0.cxx) void DimImpl(const SbxVariableRef& refVar); diff --git a/basic/source/runtime/dllmgr-none.cxx b/basic/source/runtime/dllmgr-none.cxx index bce18495b3bb..f5d48930745c 100644 --- a/basic/source/runtime/dllmgr-none.cxx +++ b/basic/source/runtime/dllmgr-none.cxx @@ -73,14 +73,14 @@ ErrCode returnInt64InOutArg(SbxArray *pArgs, SbxVariable &rRetVal, return ERRCODE_BASIC_BAD_ARGUMENT; } -ErrCode builtin_kernel32(const OUString &aFuncName, SbxArray *pArgs, +ErrCode builtin_kernel32(std::u16string_view aFuncName, SbxArray *pArgs, SbxVariable &rRetVal) { sal_Int64 nNanoSecsPerSec = 1000.0*1000*1000; - if (aFuncName == "QueryPerformanceFrequency") + if (aFuncName == u"QueryPerformanceFrequency") return returnInt64InOutArg(pArgs, rRetVal, nNanoSecsPerSec); - else if (aFuncName == "QueryPerformanceCounter") + else if (aFuncName == u"QueryPerformanceCounter") { TimeValue aNow; osl_getSystemTime( &aNow ); @@ -93,11 +93,11 @@ ErrCode builtin_kernel32(const OUString &aFuncName, SbxArray *pArgs, }; ErrCode SbiDllMgr::Call( - const OUString &aFuncName, const OUString &aDllName, + std::u16string_view aFuncName, std::u16string_view aDllName, SbxArray *pArgs, SbxVariable &rRetVal, SAL_UNUSED_PARAMETER bool /* bCDecl */) { - if (aDllName == "kernel32") + if (aDllName == u"kernel32") return builtin_kernel32(aFuncName, pArgs, rRetVal); else return ERRCODE_BASIC_NOT_IMPLEMENTED; diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx index 0cc276192fbc..9e6d6838fe6a 100644 --- a/basic/source/runtime/dllmgr-x64.cxx +++ b/basic/source/runtime/dllmgr-x64.cxx @@ -764,7 +764,7 @@ Dll * SbiDllMgr::Impl::getDll(OUString const & name) { } ErrCode SbiDllMgr::Call( - OUString const & function, OUString const & library, + std::u16string_view function, std::u16string_view library, SbxArray * arguments, SbxVariable & result, bool cdeclConvention) { if (cdeclConvention) { diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx index 3220691bbd61..12588d798aea 100644 --- a/basic/source/runtime/dllmgr-x86.cxx +++ b/basic/source/runtime/dllmgr-x86.cxx @@ -704,7 +704,7 @@ Dll * SbiDllMgr::Impl::getDll(OUString const & name) { } ErrCode SbiDllMgr::Call( - OUString const & function, OUString const & library, + std::u16string_view function, std::u16string_view library, SbxArray * arguments, SbxVariable & result, bool cdeclConvention) { if (cdeclConvention) { diff --git a/basic/source/runtime/dllmgr.hxx b/basic/source/runtime/dllmgr.hxx index 368fa3d10a2f..3f984c95105c 100644 --- a/basic/source/runtime/dllmgr.hxx +++ b/basic/source/runtime/dllmgr.hxx @@ -36,7 +36,7 @@ public: ~SbiDllMgr(); ErrCode Call( - OUString const & function, OUString const & library, + std::u16string_view function, std::u16string_view library, SbxArray * arguments, SbxVariable & result, bool cdeclConvention); void FreeDll(OUString const & library); diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 78e2a5ac4358..6ac8168358be 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1271,8 +1271,8 @@ SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection co // DLL-calls void SbiRuntime::DllCall - ( const OUString& aFuncName, - const OUString& aDLLName, + ( std::u16string_view aFuncName, + std::u16string_view aDLLName, SbxArray* pArgs, // parameter (from index 1, can be NULL) SbxDataType eResType, // return value bool bCDecl ) // true: according to C-conventions |