diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-07-17 20:56:45 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-07-17 22:33:39 +0200 |
commit | a83888e7759abd5204c76d0c3095a4d49699b834 (patch) | |
tree | cbbb60395e7fb180c634520851db34c77e044b91 | |
parent | 72b48cb904b1fc0e3155457bac28401bd39e5656 (diff) |
Fix warning for loext namespace
Define the namespace near the element that's using it
Change-Id: If0a135a331d4f67ef2dfe4981e93110e7a1a787a
Reviewed-on: https://gerrit.libreoffice.org/40084
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | xmlsecurity/inc/xmlsignaturehelper.hxx | 1 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xmlsignaturehelper.cxx | 7 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 5 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecparser.cxx | 4 |
4 files changed, 7 insertions, 10 deletions
diff --git a/xmlsecurity/inc/xmlsignaturehelper.hxx b/xmlsecurity/inc/xmlsignaturehelper.hxx index 2b2a82c413c8..d527942f50f2 100644 --- a/xmlsecurity/inc/xmlsignaturehelper.hxx +++ b/xmlsecurity/inc/xmlsignaturehelper.hxx @@ -96,7 +96,6 @@ private: rtl::Reference<XSecController> mpXSecController; bool mbError; bool mbODFPre1_2; - bool mbHasGpgSignatures; Link<LinkParamNone*,bool> maStartVerifySignatureHdl; private: diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx index e9b5ff749aa4..c7841a5d5614 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx @@ -51,7 +51,6 @@ #define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures" #define NS_DOCUMENTSIGNATURES_ODF_1_2 "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0" -#define NS_DOCUMENTSIGNATURES_LOEXT "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" #define OOXML_SIGNATURE_ORIGIN "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/origin" #define OOXML_SIGNATURE_SIGNATURE "http://schemas.openxmlformats.org/package/2006/relationships/digital-signature/signature" @@ -59,7 +58,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::uno; XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< uno::XComponentContext >& rxCtx) - : mxCtx(rxCtx), mbODFPre1_2(false), mbHasGpgSignatures(false) + : mxCtx(rxCtx), mbODFPre1_2(false) { mpXSecController = new XSecController(rxCtx); mbError = false; @@ -129,7 +128,6 @@ void XMLSignatureHelper::SetGpgCertificate(sal_Int32 nSecurityId, const OUString& ouGpgCert, const OUString& ouGpgOwner) { - mbHasGpgSignatures = true; mpXSecController->setGpgCertificate( nSecurityId, ouGpgCertDigest, @@ -181,9 +179,6 @@ uno::Reference<xml::sax::XWriter> XMLSignatureHelper::CreateDocumentHandlerWithH "xmlns", sNamespace); - if (mbHasGpgSignatures) - pAttributeList->AddAttribute("xmlns:loext", NS_DOCUMENTSIGNATURES_LOEXT); - xSaxWriter->startDocument(); xSaxWriter->startElement( "document-signatures", diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index abe8bd1760e1..e731951369c0 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -726,10 +726,13 @@ void XSecController::exportSignature( // GPG or X509 key? if (!signatureInfo.ouGpgCertificate.isEmpty()) { + pAttributeList = new SvXMLAttributeList(); + pAttributeList->AddAttribute("xmlns:loext", + "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"); /* Write PGPData element */ xDocumentHandler->startElement( "PGPData", - cssu::Reference< cssxs::XAttributeList > (new SvXMLAttributeList())); + cssu::Reference< cssxs::XAttributeList > (pAttributeList)); { /* Write keyid element */ xDocumentHandler->startElement( diff --git a/xmlsecurity/source/helper/xsecparser.cxx b/xmlsecurity/source/helper/xsecparser.cxx index 00054b4f3ef4..bcab9811faf7 100644 --- a/xmlsecurity/source/helper/xsecparser.cxx +++ b/xmlsecurity/source/helper/xsecparser.cxx @@ -194,7 +194,7 @@ void SAL_CALL XSecParser::startElement( m_ouGpgCertificate.clear(); m_bInGpgCertificate = true; } - else if (aName == "PGPOwner") + else if (aName == "loext:PGPOwner") { m_ouGpgOwner.clear(); m_bInGpgOwner = true; @@ -322,7 +322,7 @@ void SAL_CALL XSecParser::endElement( const OUString& aName ) m_pXSecController->setGpgCertificate( m_ouGpgCertificate ); m_bInGpgCertificate = false; } - else if (aName == "PGPOwner") + else if (aName == "loext:PGPOwner") { m_pXSecController->setGpgOwner( m_ouGpgOwner ); m_bInGpgOwner = false; |