diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 13:41:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-18 14:12:39 +0100 |
commit | 8d487ceba1995b5831755bb5b37a82afc2125c0f (patch) | |
tree | 1f30ab9fbc09f48b9038ae2d97f2ae80f9666d52 /xmlsecurity | |
parent | 05575c31e1f962636125ff8c42c3e2409a9edb6c (diff) |
xmlsecurity: Use appropriate OUString functions on string constants
Change-Id: I18370f6203455cf7568e48e49b7093d114656619
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/framework/decryptorimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/framework/encryptorimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/framework/signaturecreatorimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/framework/signatureverifierimpl.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xmlsignaturehelper.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 16 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecsign.cxx | 4 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/certvalidity.cxx | 34 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/nssinitializer.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx | 3 |
14 files changed, 36 insertions, 53 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 951f6fc554d2..835dc00b9cd4 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -136,7 +136,7 @@ bool DigitalSignaturesDialog::isXML(const OUString& rURI ) } if (DocumentSignatureHelper::equalsReferenceUriManifestPath(rURI, sPath)) { - bIsXML = sMediaType.equals("text/xml") && ! bEncrypted; + bIsXML = sMediaType == "text/xml" && ! bEncrypted; bPropsAvailable = true; break; } diff --git a/xmlsecurity/source/framework/decryptorimpl.cxx b/xmlsecurity/source/framework/decryptorimpl.cxx index 08914954392b..bb41a3dce52f 100644 --- a/xmlsecurity/source/framework/decryptorimpl.cxx +++ b/xmlsecurity/source/framework/decryptorimpl.cxx @@ -32,7 +32,6 @@ namespace cssl = com::sun::star::lang; namespace cssxc = com::sun::star::xml::crypto; namespace cssxw = com::sun::star::xml::wrapper; -#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Decryptor" #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.DecryptorImpl" DecryptorImpl::DecryptorImpl(const Reference< XComponentContext > & xContext) : DecryptorImpl_Base(xContext) @@ -190,10 +189,9 @@ cssu::Sequence< OUString > SAL_CALL DecryptorImpl_getSupportedServiceNames( ) { cssu::Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.xml.crypto.sax.Decryptor"; return aRet; } -#undef SERVICE_NAME cssu::Reference< cssu::XInterface > SAL_CALL DecryptorImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory >& xMSF) throw( cssu::Exception ) diff --git a/xmlsecurity/source/framework/encryptorimpl.cxx b/xmlsecurity/source/framework/encryptorimpl.cxx index 9d42d447928e..776b5327f3a6 100644 --- a/xmlsecurity/source/framework/encryptorimpl.cxx +++ b/xmlsecurity/source/framework/encryptorimpl.cxx @@ -31,7 +31,6 @@ namespace cssl = com::sun::star::lang; namespace cssxc = com::sun::star::xml::crypto; namespace cssxw = com::sun::star::xml::wrapper; -#define SERVICE_NAME "com.sun.star.xml.crypto.sax.Encryptor" #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.EncryptorImpl" EncryptorImpl::EncryptorImpl(const Reference<XComponentContext> & xContext) : EncryptorImpl_Base(xContext) @@ -224,10 +223,9 @@ Sequence< OUString > SAL_CALL EncryptorImpl_getSupportedServiceNames( ) { Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.xml.crypto.sax.Encryptor"; return aRet; } -#undef SERVICE_NAME Reference< XInterface > SAL_CALL EncryptorImpl_createInstance( const Reference< cssl::XMultiServiceFactory >& xMSF) diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx index be60a3255757..6013f2dbf369 100644 --- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx +++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx @@ -32,7 +32,6 @@ namespace cssxcsax = com::sun::star::xml::csax; namespace cssxw = com::sun::star::xml::wrapper; namespace cssxs = com::sun::star::xml::sax; -#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SAXEventKeeper" #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SAXEventKeeperImpl" #define _USECOMPRESSEDDOCUMENTHANDLER @@ -1371,10 +1370,9 @@ cssu::Sequence< OUString > SAL_CALL SAXEventKeeperImpl_getSupportedServiceNames( { cssu::Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.xml.crypto.sax.SAXEventKeeper"; return aRet; } -#undef SERVICE_NAME cssu::Reference< cssu::XInterface > SAL_CALL SAXEventKeeperImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory > &) diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx index 300d1599ddc4..68f0025bde7c 100644 --- a/xmlsecurity/source/framework/signaturecreatorimpl.cxx +++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx @@ -32,7 +32,6 @@ namespace cssl = com::sun::star::lang; namespace cssxc = com::sun::star::xml::crypto; namespace cssxw = com::sun::star::xml::wrapper; -#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureCreator" #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureCreatorImpl" SignatureCreatorImpl::SignatureCreatorImpl( const Reference<XComponentContext> & xContext ) @@ -238,10 +237,9 @@ cssu::Sequence< OUString > SAL_CALL SignatureCreatorImpl_getSupportedServiceName { cssu::Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.xml.crypto.sax.SignatureCreator"; return aRet; } -#undef SERVICE_NAME cssu::Reference< cssu::XInterface > SAL_CALL SignatureCreatorImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory >& xMSF ) diff --git a/xmlsecurity/source/framework/signatureverifierimpl.cxx b/xmlsecurity/source/framework/signatureverifierimpl.cxx index 0db81535a28e..6ef0bedc79c3 100644 --- a/xmlsecurity/source/framework/signatureverifierimpl.cxx +++ b/xmlsecurity/source/framework/signatureverifierimpl.cxx @@ -30,7 +30,6 @@ namespace cssu = com::sun::star::uno; namespace cssl = com::sun::star::lang; namespace cssxc = com::sun::star::xml::crypto; -#define SERVICE_NAME "com.sun.star.xml.crypto.sax.SignatureVerifier" #define IMPLEMENTATION_NAME "com.sun.star.xml.security.framework.SignatureVerifierImpl" SignatureVerifierImpl::SignatureVerifierImpl( const cssu::Reference< css::uno::XComponentContext >& xContext) @@ -184,10 +183,9 @@ cssu::Sequence< OUString > SAL_CALL SignatureVerifierImpl_getSupportedServiceNam { cssu::Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( SERVICE_NAME ); + pArray[0] = "com.sun.star.xml.crypto.sax.SignatureVerifier"; return aRet; } -#undef SERVICE_NAME cssu::Reference< cssu::XInterface > SAL_CALL SignatureVerifierImpl_createInstance( const cssu::Reference< cssl::XMultiServiceFactory >& rSMgr) diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index 931ded8c0265..4ffe2c27d243 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -162,9 +162,9 @@ uno::Reference<xml::sax::XWriter> XMLSignatureHelper::CreateDocumentHandlerWithH SvXMLAttributeList *pAttributeList = new SvXMLAttributeList(); OUString sNamespace; if (mbODFPre1_2) - sNamespace = OUString(NS_DOCUMENTSIGNATURES); + sNamespace = NS_DOCUMENTSIGNATURES; else - sNamespace = OUString(NS_DOCUMENTSIGNATURES_ODF_1_2); + sNamespace = NS_DOCUMENTSIGNATURES_ODF_1_2; pAttributeList->AddAttribute( OUString(ATTR_XMLNS), diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 7fdddc37b0b9..9c65d88020a2 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -792,7 +792,7 @@ void XSecController::exportSignature( { pAttributeList->AddAttribute( OUString(ATTR_URI), - OUString(CHAR_FRAGMENT)+refInfor.ouURI); + CHAR_FRAGMENT+refInfor.ouURI); } xDocumentHandler->startElement( tag_Reference, cssu::Reference< cssxs::XAttributeList > (pAttributeList) ); @@ -910,7 +910,7 @@ void XSecController::exportSignature( signatureInfo.ouPropertyId); pAttributeList->AddAttribute( OUString(ATTR_TARGET), - OUString(CHAR_FRAGMENT)+signatureInfo.ouSignatureId); + CHAR_FRAGMENT+signatureInfo.ouSignatureId); xDocumentHandler->startElement( tag_SignatureProperty, cssu::Reference< cssxs::XAttributeList > (pAttributeList)); @@ -919,15 +919,11 @@ void XSecController::exportSignature( pAttributeList = new SvXMLAttributeList(); pAttributeList->AddAttribute( - OUString(ATTR_XMLNS) - + ":" - + OUString(NSTAG_DC), + ATTR_XMLNS ":" NSTAG_DC, OUString(NS_DC)); xDocumentHandler->startElement( - OUString(NSTAG_DC) - + ":" - + tag_Date, + NSTAG_DC ":" + tag_Date, cssu::Reference< cssxs::XAttributeList > (pAttributeList)); OUStringBuffer buffer; @@ -944,9 +940,7 @@ void XSecController::exportSignature( xDocumentHandler->characters( buffer.makeStringAndClear() ); xDocumentHandler->endElement( - OUString(NSTAG_DC) - + ":" - + tag_Date); + NSTAG_DC ":" + tag_Date); } xDocumentHandler->endElement( tag_SignatureProperty ); } diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index ca8edf92c774..750713fc1467 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -161,7 +161,7 @@ void SAL_CALL XSecParser::startElement( } else if (aName == TAG_DIGESTVALUE) { - m_ouDigestValue = ""; + m_ouDigestValue.clear(); m_bInDigestValue = true; } else if ( aName == TAG_SIGNATUREPROPERTY ) diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx index b67933f931ec..ad706b04725a 100644 --- a/xmlsecurity/source/helper/xsecsign.cxx +++ b/xmlsecurity/source/helper/xsecsign.cxx @@ -175,10 +175,10 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar for(i=0; i<size; ++i) { SignatureReferenceInformation& refInfor = vReferenceInfors[i]; - refInfor.ouDigestValue = OUString(CHAR_BLANK); + refInfor.ouDigestValue = CHAR_BLANK; } - internalSignatureInfor.signatureInfor.ouSignatureValue = OUString(CHAR_BLANK); + internalSignatureInfor.signatureInfor.ouSignatureValue = CHAR_BLANK; return xReferenceResolvedListener; } diff --git a/xmlsecurity/source/xmlsec/certvalidity.cxx b/xmlsecurity/source/xmlsec/certvalidity.cxx index f27dd208de19..0bfc432fa973 100644 --- a/xmlsecurity/source/xmlsec/certvalidity.cxx +++ b/xmlsecurity/source/xmlsec/certvalidity.cxx @@ -45,39 +45,39 @@ OUString certificateValidityToOUString( ::sal_Int32 certValidity ) { OUString aValidity ; if( certValidity == CertificateValidity::VALID ) { - aValidity = OUString(VALID_STR ) ; + aValidity = VALID_STR; } else if( ( certValidity & CertificateValidity::UNTRUSTED ) == CertificateValidity::UNTRUSTED ) { - aValidity = OUString(UNTRUSTED_STR ) ; + aValidity = UNTRUSTED_STR; } else if( ( certValidity & CertificateValidity::TIME_INVALID ) == CertificateValidity::TIME_INVALID ) { - aValidity = OUString(TIME_INVALID_STR ) ; + aValidity = TIME_INVALID_STR; } else if( ( certValidity & CertificateValidity::NOT_TIME_NESTED ) == CertificateValidity::NOT_TIME_NESTED ) { - aValidity = OUString(NOT_NESTED_TIME_STR ) ; + aValidity = NOT_NESTED_TIME_STR; } else if( ( certValidity & CertificateValidity::REVOKED ) == CertificateValidity::REVOKED ) { - aValidity = OUString(REVOKED_STR ) ; + aValidity = REVOKED_STR; } else if( ( certValidity & CertificateValidity::UNKNOWN_REVOKATION ) == CertificateValidity::UNKNOWN_REVOKATION ) { - aValidity = OUString(UNKNOWN_REVOKATION_STR ) ; + aValidity = UNKNOWN_REVOKATION_STR; } else if( ( certValidity & CertificateValidity::SIGNATURE_INVALID ) == CertificateValidity::SIGNATURE_INVALID ) { - aValidity = OUString(SIGNATURE_INVALID_STR ) ; + aValidity = SIGNATURE_INVALID_STR; } else if( ( certValidity & CertificateValidity::EXTENSION_INVALID ) == CertificateValidity::EXTENSION_INVALID ) { - aValidity = OUString(EXTENSION_INVALID_STR ) ; + aValidity = EXTENSION_INVALID_STR; } else if( ( certValidity & CertificateValidity::EXTENSION_UNKNOWN ) == CertificateValidity::EXTENSION_UNKNOWN ) { - aValidity = OUString(EXTENSION_UNKNOWN_STR ) ; + aValidity = EXTENSION_UNKNOWN_STR; } else if( ( certValidity & CertificateValidity::ISSUER_UNKNOWN ) == CertificateValidity::ISSUER_UNKNOWN ) { - aValidity = OUString(ISSUER_UNKNOWN_STR ) ; + aValidity = ISSUER_UNKNOWN_STR; } else if( ( certValidity & CertificateValidity::ISSUER_UNTRUSTED ) == CertificateValidity::ISSUER_UNTRUSTED ) { - aValidity = OUString(ISSUER_UNTRUSTED_STR ) ; + aValidity = ISSUER_UNTRUSTED_STR; } else if( ( certValidity & CertificateValidity::ISSUER_INVALID ) == CertificateValidity::ISSUER_INVALID ) { - aValidity = OUString(ISSUER_INVALID_STR ) ; + aValidity = ISSUER_INVALID_STR; } else if( ( certValidity & CertificateValidity::ROOT_UNKNOWN ) == CertificateValidity::ROOT_UNKNOWN ) { - aValidity = OUString(ROOT_UNKNOWN_STR ) ; + aValidity = ROOT_UNKNOWN_STR; } else if( ( certValidity & CertificateValidity::ROOT_UNTRUSTED ) == CertificateValidity::ROOT_UNTRUSTED ) { - aValidity = OUString(ROOT_UNTRUSTED_STR ) ; + aValidity = ROOT_UNTRUSTED_STR; } else if( ( certValidity & CertificateValidity::ROOT_INVALID ) == CertificateValidity::ROOT_INVALID ) { - aValidity = OUString(ROOT_INVALID_STR ) ; + aValidity = ROOT_INVALID_STR; } else if( ( certValidity & CertificateValidity::CHAIN_INCOMPLETE ) == CertificateValidity::CHAIN_INCOMPLETE ) { - aValidity = OUString(CHAIN_INCOMPLETE_STR ) ; + aValidity = CHAIN_INCOMPLETE_STR; } else { - aValidity = OUString(INVALID_STR ) ; + aValidity = INVALID_STR; } return aValidity ; diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index e35f44c78cb5..faede8aa8321 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -474,7 +474,7 @@ cssu::Sequence< OUString > SAL_CALL ONSSInitializer_getSupportedServiceNames( ) { cssu::Sequence < OUString > aRet(1); OUString* pArray = aRet.getArray(); - pArray[0] = OUString ( NSS_SERVICE_NAME ); + pArray[0] = NSS_SERVICE_NAME; return aRet; } diff --git a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx index bac83e4050be..684aebc7589d 100644 --- a/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx @@ -123,7 +123,7 @@ uno::Sequence< OUString > SAL_CALL SEInitializer_NssImpl_getSupportedServiceName uno::Sequence < OUString > aRet(2); OUString* pArray = aRet.getArray(); pArray[0] = "com.sun.star.xml.crypto.SEInitializer"; - pArray[1] = OUString ( NSS_SERVICE_NAME ); + pArray[1] = NSS_SERVICE_NAME; return aRet; } diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index cf2377a5a3bc..658fce053812 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -257,8 +257,7 @@ void XMLDocumentWrapper_XmlSecImpl::sendStartElement( else { ouAttrName = OUString(C2U( (sal_Char*)pAttrNs->prefix)) - +OUString(":") - +OUString(C2U( (sal_Char*)pAttrName )); + + ":" + OUString(C2U( (sal_Char*)pAttrName )); } pAttributeList->AddAttribute( |