summaryrefslogtreecommitdiff
path: root/xmlsecurity/source/helper/xmlsignaturehelper.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-05-14 09:22:07 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-05-14 09:22:07 +0000
commit07fe652d9ceb20c5511c147e36ab4b7f3ea421a3 (patch)
tree957209e868e9197b4ff28bbd98faf3e056cb62a3 /xmlsecurity/source/helper/xmlsignaturehelper.cxx
parentbf583661a247036b22b396d58f684235c024fcc7 (diff)
INTEGRATION: CWS jl93 (1.26.64); FILE MERGED
2008/05/05 13:13:19 jl 1.26.64.3: RESYNC: (1.26-1.27); FILE MERGED 2008/03/28 09:33:24 jl 1.26.64.2: #i86651# 2008/03/20 10:10:58 jl 1.26.64.1: #i86651# changes for ODF 1.2 conform signature
Diffstat (limited to 'xmlsecurity/source/helper/xmlsignaturehelper.cxx')
-rw-r--r--xmlsecurity/source/helper/xmlsignaturehelper.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/xmlsecurity/source/helper/xmlsignaturehelper.cxx b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
index a7615e0e9d4f..c767ba5f4d78 100644
--- a/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/xmlsignaturehelper.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlsignaturehelper.cxx,v $
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
* This file is part of OpenOffice.org.
*
@@ -32,6 +32,7 @@
#include "precompiled_xmlsecurity.hxx"
#include <xmlsecurity/xmlsignaturehelper.hxx>
+#include <xmlsecurity/documentsignaturehelper.hxx>
#include <xsecctl.hxx>
#include <xmlsignaturehelper2.hxx>
@@ -58,11 +59,12 @@
#define TAG_DOCUMENTSIGNATURES "document-signatures"
#define NS_DOCUMENTSIGNATURES "http://openoffice.org/2004/documentsignatures"
+#define NS_DOCUMENTSIGNATURES_ODF_1_2 "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0"
using namespace ::com::sun::star;
-XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServiceFactory>& rxMSF )
- : mxMSF(rxMSF)
+XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServiceFactory>& rxMSF)
+ : mxMSF(rxMSF), mbODFPre1_2(false)
{
mpXSecController = new XSecController;
mxSecurityController = mpXSecController;
@@ -112,6 +114,8 @@ void XMLSignatureHelper::SetStorage( const com::sun::star::uno::Reference < com:
{
DBG_ASSERT( !mxUriBinding.is(), "SetStorage - UriBinding already set!" );
mxUriBinding = new UriBindingHelper( rxStorage );
+ DBG_ASSERT(rxStorage.is(), "SetStorage - empty storage!");
+ mbODFPre1_2 = DocumentSignatureHelper::isODFPre_1_2(rxStorage);
}
@@ -220,9 +224,15 @@ uno::Reference<xml::sax::XDocumentHandler> XMLSignatureHelper::CreateDocumentHan
rtl::OUString tag_AllSignatures(RTL_CONSTASCII_USTRINGPARAM(TAG_DOCUMENTSIGNATURES));
SvXMLAttributeList *pAttributeList = new SvXMLAttributeList();
+ rtl::OUString sNamespace;
+ if (mbODFPre1_2)
+ sNamespace = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DOCUMENTSIGNATURES));
+ else
+ sNamespace = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DOCUMENTSIGNATURES_ODF_1_2));
+
pAttributeList->AddAttribute(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ATTR_XMLNS)),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(NS_DOCUMENTSIGNATURES)));
+ sNamespace);
xDocHandler->startDocument();
xDocHandler->startElement(