diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-13 10:27:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-29 08:18:35 +0200 |
commit | 71112060e0930fc58087c3762e836b1e12b60f75 (patch) | |
tree | 3bd54aa5b5864d9cd31d0aa3ec4080b46cf66a2d /xmlsecurity/source/helper/documentsignaturehelper.cxx | |
parent | d6da9e495d7ca32de6cda1a94cb4c8cd26b240cc (diff) |
loplugin:oncevar various
Change-Id: I8b82d46d4688b1a59d6fe1b05da7d5c8dfc13ca6
Reviewed-on: https://gerrit.libreoffice.org/38766
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity/source/helper/documentsignaturehelper.cxx')
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturehelper.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx index fadf1a6309b2..1eecea496128 100644 --- a/xmlsecurity/source/helper/documentsignaturehelper.cxx +++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx @@ -139,13 +139,12 @@ bool DocumentSignatureHelper::isODFPre_1_2(const OUString & sVersion) bool DocumentSignatureHelper::isOOo3_2_Signature(const SignatureInformation & sigInfo) { - OUString sManifestURI("META-INF/manifest.xml"); bool bOOo3_2 = false; typedef ::std::vector< SignatureReferenceInformation >::const_iterator CIT; for (CIT i = sigInfo.vSignatureReferenceInfors.begin(); i < sigInfo.vSignatureReferenceInfors.end(); ++i) { - if (i->ouURI.equals(sManifestURI)) + if (i->ouURI == "META-INF/manifest.xml") { bOOo3_2 = true; break; @@ -223,14 +222,13 @@ DocumentSignatureHelper::CreateElementList( xSubStore.clear(); // Object folders... - OUString aMatchStr( "Object " ); Reference < css::container::XNameAccess > xElements( rxStore, UNO_QUERY ); Sequence< OUString > aElementNames = xElements->getElementNames(); sal_Int32 nElements = aElementNames.getLength(); const OUString* pNames = aElementNames.getConstArray(); for ( sal_Int32 n = 0; n < nElements; n++ ) { - if ( ( pNames[n].match( aMatchStr ) ) && rxStore->isStorageElement( pNames[n] ) ) + if ( ( pNames[n].match( "Object " ) ) && rxStore->isStorageElement( pNames[n] ) ) { Reference < css::embed::XStorage > xTmpSubStore = rxStore->openStorageElement( pNames[n], css::embed::ElementModes::READ ); ImplFillElementList(aElements, xTmpSubStore, pNames[n]+aSep, true, mode); @@ -305,8 +303,7 @@ void DocumentSignatureHelper::AppendContentTypes(const uno::Reference<embed::XSt // ODF return; - sal_Int32 nOpenMode = embed::ElementModes::READ; - uno::Reference<io::XInputStream> xRelStream(xStorage->openStreamElement("[Content_Types].xml", nOpenMode), uno::UNO_QUERY); + uno::Reference<io::XInputStream> xRelStream(xStorage->openStreamElement("[Content_Types].xml", embed::ElementModes::READ), uno::UNO_QUERY); uno::Sequence< uno::Sequence<beans::StringPair> > aContentTypeInfo = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xRelStream, comphelper::getProcessComponentContext()); if (aContentTypeInfo.getLength() < 2) { @@ -362,8 +359,7 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream( { try { - OUString aSIGStoreName( "META-INF" ); - aHelper.xSignatureStorage = rxStore->openStorageElement( aSIGStoreName, nSubStorageOpenMode ); + aHelper.xSignatureStorage = rxStore->openStorageElement( "META-INF", nSubStorageOpenMode ); if ( aHelper.xSignatureStorage.is() ) { OUString aSIGStreamName; |