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:
@@ -27,6 +27,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <string_view>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <basic/sbx.hxx>
|
#include <basic/sbx.hxx>
|
||||||
@@ -496,7 +497,7 @@ ErrCode call(
|
|||||||
// require similar treatment, too:
|
// require similar treatment, too:
|
||||||
bool special =
|
bool special =
|
||||||
dll.equalsIgnoreAsciiCase("KERNEL32.DLL") &&
|
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)
|
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(),
|
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
|
else
|
||||||
{
|
{
|
||||||
aResult += OUString( pStr, 1 );
|
aResult += OUStringChar( *pStr );
|
||||||
pStr++;
|
pStr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1427,9 +1427,8 @@ uno::Any SAL_CALL IUnknownWrapper::directInvoke( const OUString& aName, const un
|
|||||||
"DISP_E_BADVARTYPE.", nullptr);
|
"DISP_E_BADVARTYPE.", nullptr);
|
||||||
break;
|
break;
|
||||||
case DISP_E_EXCEPTION:
|
case DISP_E_EXCEPTION:
|
||||||
message = "[automation bridge]: "
|
message = OUString::Concat("[automation bridge]: ")
|
||||||
+ OUString(o3tl::toU(excepinfo.bstrDescription),
|
+ o3tl::toU(excepinfo.bstrDescription);
|
||||||
::SysStringLen(excepinfo.bstrDescription));
|
|
||||||
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
||||||
break;
|
break;
|
||||||
case DISP_E_MEMBERNOTFOUND:
|
case DISP_E_MEMBERNOTFOUND:
|
||||||
@@ -2049,9 +2048,8 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
|
|||||||
"DISP_E_BADVARTYPE.", nullptr);
|
"DISP_E_BADVARTYPE.", nullptr);
|
||||||
break;
|
break;
|
||||||
case DISP_E_EXCEPTION:
|
case DISP_E_EXCEPTION:
|
||||||
message = "[automation bridge]: "
|
message = OUString::Concat("[automation bridge]: ")
|
||||||
+ OUString(o3tl::toU(excepinfo.bstrDescription),
|
+ o3tl::toU(excepinfo.bstrDescription);
|
||||||
::SysStringLen(excepinfo.bstrDescription));
|
|
||||||
|
|
||||||
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
throw InvocationTargetException(message, Reference<XInterface>(), Any());
|
||||||
break;
|
break;
|
||||||
|
@@ -7,6 +7,10 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
* 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/cryptosign.hxx>
|
||||||
#include <svl/sigstruct.hxx>
|
#include <svl/sigstruct.hxx>
|
||||||
#include <config_crypto.h>
|
#include <config_crypto.h>
|
||||||
@@ -2131,9 +2135,9 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto pDigestID = reinterpret_cast<CRYPT_ALGORITHM_IDENTIFIER*>(pDigestBytes.get());
|
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;
|
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;
|
rInformation.nDigestID = xml::crypto::DigestID::SHA1;
|
||||||
else
|
else
|
||||||
// Don't error out here, we can still verify the message digest correctly, just the digest ID won't be set.
|
// 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)
|
* { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
|
||||||
* smime(16) id-aa(2) 47 }
|
* 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;
|
rInformation.bHasSigningCertificate = true;
|
||||||
break;
|
break;
|
||||||
@@ -2262,7 +2266,7 @@ bool Signing::Verify(const std::vector<unsigned char>& aData,
|
|||||||
{
|
{
|
||||||
CRYPT_ATTRIBUTE& rAttr = pSignedAttributes->rgAttr[nAttr];
|
CRYPT_ATTRIBUTE& rAttr = pSignedAttributes->rgAttr[nAttr];
|
||||||
// Timestamp blob
|
// 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;
|
PCRYPT_TIMESTAMP_CONTEXT pTsContext;
|
||||||
if (!CryptVerifyTimeStampSignature(rAttr.rgValue->pbData, rAttr.rgValue->cbData, nullptr, 0, nullptr, &pTsContext, nullptr, nullptr))
|
if (!CryptVerifyTimeStampSignature(rAttr.rgValue->pbData, rAttr.rgValue->cbData, nullptr, 0, nullptr, &pTsContext, nullptr, nullptr))
|
||||||
|
Reference in New Issue
Block a user