From 963264a417ce807201f0021fc6000ce7d6cf0245 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 3 Mar 2016 15:32:48 +0100 Subject: [PATCH] xmlsecurity OOXML export: don't loose old signatures when adding a new one With this, at least we don't completely throw away existing signatures. The roundtrip of them isn't perfect yet, though. Change-Id: Ibc3408364403a057169e384902afe13b1e397480 --- xmlsecurity/source/helper/documentsignaturemanager.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 7f0fc66e7cd3..b5bc008b1ddf 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -269,6 +269,10 @@ bool DocumentSignatureManager::add(const uno::Reference& int nSignatureCount = maCurrentSignatureInformations.size() + 1; maSignatureHelper.ExportSignatureRelations(aStreamHelper.xSignatureStorage, nSignatureCount); + // Export old signatures. + for (size_t i = 0; i < maCurrentSignatureInformations.size(); ++i) + maSignatureHelper.ExportOOXMLSignature(mxStore, aStreamHelper.xSignatureStorage, maCurrentSignatureInformations[i], i + 1); + // Create a new signature. maSignatureHelper.CreateAndWriteOOXMLSignature(mxStore, aStreamHelper.xSignatureStorage, nSignatureCount);