loplugin:stringview (clang-cl)
Change-Id: Id1f8f24fec638efcdf5a04ca7253e6f401afd2fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116548 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
parent
1193c33194
commit
eebd84b337
@ -27,6 +27,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <basic/sbx.hxx>
|
||||
@ -496,7 +497,7 @@ ErrCode call(
|
||||
// require similar treatment, too:
|
||||
bool special =
|
||||
dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
|
||||
(proc.name == OString("GetLogicalDriveStringsA"));
|
||||
(proc.name == std::string_view("GetLogicalDriveStringsA"));
|
||||
for (sal_uInt32 i = 1; i < (arguments == nullptr ? 0 : arguments->Count()); ++i)
|
||||
{
|
||||
ErrCode e = marshal(true, arguments->Get(i), special && i == 2, stack, stack.size(),
|
||||
|
@ -418,7 +418,7 @@ static OUString WinAccToVcl_Impl( const sal_Unicode* pStr )
|
||||
}
|
||||
else
|
||||
{
|
||||
aResult += OUString( pStr, 1 );
|
||||
aResult += OUStringChar( *pStr );
|
||||
pStr++;
|
||||
}
|
||||
}
|
||||
|
@ -1427,9 +1427,8 @@ uno::Any SAL_CALL IUnknownWrapper::directInvoke( const OUString& aName, const un
|
||||
"DISP_E_BADVARTYPE.", nullptr);
|
||||
break;
|
||||
case DISP_E_EXCEPTION:
|
||||
message = "[automation bridge]: "
|
||||
+ OUString(o3tl::toU(excepinfo.bstrDescription),
|
||||
::SysStringLen(excepinfo.bstrDescription));
|
||||
message = OUString::Concat("[automation bridge]: ")
|
||||
+ o3tl::toU(excepinfo.bstrDescription);
|
||||
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
||||
break;
|
||||
case DISP_E_MEMBERNOTFOUND:
|
||||
@ -2049,9 +2048,8 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
|
||||
"DISP_E_BADVARTYPE.", nullptr);
|
||||
break;
|
||||
case DISP_E_EXCEPTION:
|
||||
message = "[automation bridge]: "
|
||||
+ OUString(o3tl::toU(excepinfo.bstrDescription),
|
||||
::SysStringLen(excepinfo.bstrDescription));
|
||||
message = OUString::Concat("[automation bridge]: ")
|
||||
+ o3tl::toU(excepinfo.bstrDescription);
|
||||
|
||||
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
||||
break;
|
||||
|
@ -7,6 +7,10 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <svl/cryptosign.hxx>
|
||||
#include <svl/sigstruct.hxx>
|
||||
#include <config_crypto.h>
|
||||
@ -2131,9 +2135,9 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
|
||||
return false;
|
||||
}
|
||||
auto pDigestID = reinterpret_cast<CRYPT_ALGORITHM_IDENTIFIER*>(pDigestBytes.get());
|
||||
if (OString(szOID_NIST_sha256) == pDigestID->pszObjId)
|
||||
if (std::string_view(szOID_NIST_sha256) == pDigestID->pszObjId)
|
||||
rInformation.nDigestID = xml::crypto::DigestID::SHA256;
|
||||
else if (OString(szOID_RSA_SHA1RSA) == pDigestID->pszObjId || OString(szOID_OIWSEC_sha1) == pDigestID->pszObjId)
|
||||
else if (std::string_view(szOID_RSA_SHA1RSA) == pDigestID->pszObjId || std::string_view(szOID_OIWSEC_sha1) == pDigestID->pszObjId)
|
||||
rInformation.nDigestID = xml::crypto::DigestID::SHA1;
|
||||
else
|
||||
// Don't error out here, we can still verify the message digest correctly, just the digest ID won't be set.
|
||||
@ -2239,7 +2243,7 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
|
||||
* { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
|
||||
* smime(16) id-aa(2) 47 }
|
||||
*/
|
||||
if (OString("1.2.840.113549.1.9.16.2.47") == rAttr.pszObjId)
|
||||
if (std::string_view("1.2.840.113549.1.9.16.2.47") == rAttr.pszObjId)
|
||||
{
|
||||
rInformation.bHasSigningCertificate = true;
|
||||
break;
|
||||
@ -2262,7 +2266,7 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
|
||||
{
|
||||
CRYPT_ATTRIBUTE& rAttr = pSignedAttributes->rgAttr[nAttr];
|
||||
// Timestamp blob
|
||||
if (OString("1.2.840.113549.1.9.16.2.14") == rAttr.pszObjId)
|
||||
if (std::string_view("1.2.840.113549.1.9.16.2.14") == rAttr.pszObjId)
|
||||
{
|
||||
PCRYPT_TIMESTAMP_CONTEXT pTsContext;
|
||||
if (!CryptVerifyTimeStampSignature(rAttr.rgValue->pbData, rAttr.rgValue->cbData, nullptr, 0, nullptr, &pTsContext, nullptr, nullptr))
|
||||
|
Loading…
x
Reference in New Issue
Block a user