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 /comphelper/source | |
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 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/docpasswordhelper.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index d528d57e5cbf..4cc0f5c74269 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -260,16 +260,16 @@ std::vector<unsigned char> DocPasswordHelper::GetOoxHashAsVector( const std::vector<unsigned char>& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName) + std::u16string_view rAlgorithmName) { comphelper::HashType eType; - if (rAlgorithmName == "SHA-512" || rAlgorithmName == "SHA512") + if (rAlgorithmName == u"SHA-512" || rAlgorithmName == u"SHA512") eType = comphelper::HashType::SHA512; - else if (rAlgorithmName == "SHA-256" || rAlgorithmName == "SHA256") + else if (rAlgorithmName == u"SHA-256" || rAlgorithmName == u"SHA256") eType = comphelper::HashType::SHA256; - else if (rAlgorithmName == "SHA-1" || rAlgorithmName == "SHA1") // "SHA1" might be in the wild + else if (rAlgorithmName == u"SHA-1" || rAlgorithmName == u"SHA1") // "SHA1" might be in the wild eType = comphelper::HashType::SHA1; - else if (rAlgorithmName == "MD5") + else if (rAlgorithmName == u"MD5") eType = comphelper::HashType::MD5; else return std::vector<unsigned char>(); @@ -283,7 +283,7 @@ css::uno::Sequence<sal_Int8> DocPasswordHelper::GetOoxHashAsSequence( const OUString& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName) + std::u16string_view rAlgorithmName) { std::vector<unsigned char> aSaltVec; if (!rSaltValue.isEmpty()) @@ -303,7 +303,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64( const OUString& rSaltValue, sal_uInt32 nSpinCount, comphelper::Hash::IterCount eIterCount, - const OUString& rAlgorithmName) + std::u16string_view rAlgorithmName) { css::uno::Sequence<sal_Int8> aSeq( GetOoxHashAsSequence( rPassword, rSaltValue, nSpinCount, eIterCount, rAlgorithmName)); |