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
This commit is contained in:
Miklos Vajna 2016-03-03 15:32:48 +01:00
parent 122c01989d
commit 963264a417

View file

@ -269,6 +269,10 @@ bool DocumentSignatureManager::add(const uno::Reference<security::XCertificate>&
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);