diff options
Diffstat (limited to 'xmlsecurity/source')
7 files changed, 20 insertions, 15 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index ac9f25ce41c9..10e099dbf432 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -569,7 +569,7 @@ DocumentDigitalSignatures::ImplVerifySignatures( // collide, or PGPKeyID format might change - can't we // keep the xCert itself in rInfo? rSigInfo.Signer = xGpgSecEnv->getCertificate( - rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger("")); + rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger(u"")); rSigInfo.CertificateStatus = xGpgSecEnv->verifyCertificate( rSigInfo.Signer, Sequence<Reference<css::security::XCertificate>>()); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index ebce8634f96c..c29f43b4b91b 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -721,7 +721,7 @@ uno::Reference<security::XCertificate> DigitalSignaturesDialog::getCertificate(c if (!xCert.is() && xSecEnv.is()) xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xmlsecurity::numericStringToBigInteger( rInfo.ouX509SerialNumber ) ); if (!xCert.is() && xGpgSecEnv.is()) - xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger("") ); + xCert = xGpgSecEnv->getCertificate( rInfo.ouGpgKeyID, xmlsecurity::numericStringToBigInteger(u"") ); SAL_WARN_IF( !xCert.is(), "xmlsecurity.dialogs", "Certificate not found and can't be created!" ); diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx index 0bfcbd326de1..3615eb73a54a 100644 --- a/xmlsecurity/source/xmlsec/biginteger.cxx +++ b/xmlsecurity/source/xmlsec/biginteger.cxx @@ -27,7 +27,7 @@ using namespace ::com::sun::star::uno ; namespace xmlsecurity { -Sequence< sal_Int8 > numericStringToBigInteger ( const OUString& numeral ) +Sequence< sal_Int8 > numericStringToBigInteger ( std::u16string_view numeral ) { xmlChar* chNumeral ; const xmlSecByte* bnInteger ; diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index 1a0444f638bc..ccf61e106e57 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -432,7 +432,7 @@ Sequence< Reference < XCertificate > > SecurityEnvironment_NssImpl::buildCertifi X509Certificate_NssImpl* SecurityEnvironment_NssImpl::createAndAddCertificateFromPackage( const css::uno::Sequence<sal_Int8>& raDERCertificate, - OUString const & raString) + std::u16string_view raString) { auto pCertificateBytes = reinterpret_cast<char *>(const_cast<sal_Int8 *>(raDERCertificate.getConstArray())); CERTCertificate* pCERTCertificate = CERT_DecodeCertFromPackage(pCertificateBytes, raDERCertificate.getLength()); @@ -913,7 +913,7 @@ uno::Reference<security::XCertificate> SecurityEnvironment_NssImpl::createDERCer if (!pPrivateKey) return uno::Reference<security::XCertificate>(); - X509Certificate_NssImpl* pX509Certificate = createAndAddCertificateFromPackage(raDERCertificate, "TCu,TCu,TCu"); + X509Certificate_NssImpl* pX509Certificate = createAndAddCertificateFromPackage(raDERCertificate, u"TCu,TCu,TCu"); if (!pX509Certificate) return uno::Reference<security::XCertificate>(); diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx index 117e2c2945f2..fcc51072a690 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx @@ -35,6 +35,8 @@ #include <keythi.h> #include <certt.h> + +#include <string_view> #include <vector> #include <xmlsec-wrapper.h> @@ -131,7 +133,7 @@ private: static X509Certificate_NssImpl* createAndAddCertificateFromPackage( const css::uno::Sequence<sal_Int8>& raDerCertificate, - OUString const & raString); + std::u16string_view raString); static SECKEYPrivateKey* insertPrivateKey(css::uno::Sequence<sal_Int8> const & raPrivateKey); static X509Certificate_NssImpl* createX509CertificateFromDER(const css::uno::Sequence<sal_Int8>& raDerCertificate); diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index f34766666cd1..ff576db49673 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> #include <rtl/ustring.hxx> @@ -34,7 +37,7 @@ * The return value is NULL terminated. The application has the responsibility to * deallocate the return value. */ -static xmlChar* ous_to_xmlstr( const OUString& oustr ) +static xmlChar* ous_to_xmlstr( std::u16string_view oustr ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; return xmlStrndup( reinterpret_cast<xmlChar const *>(ostr.getStr()), static_cast<int>(ostr.getLength()) ) ; @@ -44,7 +47,7 @@ static xmlChar* ous_to_xmlstr( const OUString& oustr ) * The return value is NULL terminated. The application has the responsibility to * deallocate the return value. */ -static xmlChar* ous_to_nxmlstr( const OUString& oustr, int& length ) +static xmlChar* ous_to_nxmlstr( std::u16string_view oustr, int& length ) { OString ostr = OUStringToOString( oustr , RTL_TEXTENCODING_UTF8 ) ; length = ostr.getLength(); @@ -248,7 +251,7 @@ void SAXHelper::endDocument() * XDocumentHandler -- start an xml element */ void SAXHelper::startElement( - const OUString& aName, + std::u16string_view aName, const css::uno::Sequence< css::xml::csax::XMLAttribute >& aAttributes ) { const xmlChar* fullName = nullptr ; @@ -284,7 +287,7 @@ void SAXHelper::startElement( /** * XDocumentHandler -- end an xml element */ -void SAXHelper::endElement( const OUString& aName ) +void SAXHelper::endElement( std::u16string_view aName ) { xmlChar* fullname = ous_to_xmlstr( aName ) ; m_pSaxHandler->endElement( m_pParserCtxt , fullname ) ; @@ -299,7 +302,7 @@ void SAXHelper::endElement( const OUString& aName ) /** * XDocumentHandler -- an xml element or cdata characters */ -void SAXHelper::characters( const OUString& aChars ) +void SAXHelper::characters( std::u16string_view aChars ) { const xmlChar* chars = nullptr ; int length = 0 ; @@ -316,7 +319,7 @@ void SAXHelper::characters( const OUString& aChars ) /** * XDocumentHandler -- ignorable xml white space */ -void SAXHelper::ignorableWhitespace( const OUString& aWhitespaces ) +void SAXHelper::ignorableWhitespace( std::u16string_view aWhitespaces ) { const xmlChar* chars = nullptr ; int length = 0 ; @@ -334,8 +337,8 @@ void SAXHelper::ignorableWhitespace( const OUString& aWhitespaces ) * XDocumentHandler -- preprocessing instruction */ void SAXHelper::processingInstruction( - const OUString& aTarget, - const OUString& aData ) + std::u16string_view aTarget, + std::u16string_view aData ) { xmlChar* target = nullptr ; xmlChar* data = nullptr ; diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index b7313cbad8ff..800724a84051 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -53,7 +53,7 @@ XMLDocumentWrapper_XmlSecImpl::XMLDocumentWrapper_XmlSecImpl() /* * creates the virtual root element */ - saxHelper.startElement("root", uno::Sequence<css::xml::csax::XMLAttribute>()); + saxHelper.startElement(u"root", uno::Sequence<css::xml::csax::XMLAttribute>()); m_pRootElement = saxHelper.getCurrentNode(); m_pCurrentElement = m_pRootElement; |