xmlsecurity OOXML export: remove signature content types when removing ...

... signatures.

ExportSignatureContentTypes() was already a "remove all, and then re-add
necessary entries" operation, so just make sure we still call it for
zero signatures and it'll do the right thing.

Change-Id: If9182b39ac6d8f2cf66f33a02d9ddcab170ba5ea
This commit is contained in:
Miklos Vajna
2016-03-07 12:09:44 +01:00
parent 7d7cd95840
commit 1a04b1e4f2

View File

@@ -374,11 +374,9 @@ void DocumentSignatureManager::write()
{
// OOXML
size_t nSignatureCount = maCurrentSignatureInformations.size();
maSignatureHelper.ExportSignatureContentTypes(mxStore, nSignatureCount);
if (nSignatureCount > 0)
{
maSignatureHelper.ExportSignatureContentTypes(mxStore, nSignatureCount);
maSignatureHelper.ExportSignatureRelations(aStreamHelper.xSignatureStorage, nSignatureCount);
}
else
{
// Removing all signatures: then need to remove the signature relation as well.