summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-03-07 11:10:53 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-03-07 15:00:14 +0100
commite60abe659d7448ae6f839740dcfe87fd8b1520d7 (patch)
tree6df14d158b71fa27f09ce4c82ddccbd1e524c3e7 /xmlsecurity
parent57e6b9f3f4861f6283841e24a189eae3c02db9e8 (diff)
xmlsecurity OOXML export: remove signature storage with the last signature
So that no empty _xmlsignatures directory is left around after removing signatures. Change-Id: I3af77ba943a483a009a4eebaf40a58404f479e5a
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 8a568bd107d4..505554e89e1f 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -383,6 +383,9 @@ void DocumentSignatureManager::write()
{
// Removing all signatures: then need to remove the signature relation as well.
maSignatureHelper.EnsureSignaturesRelation(mxStore, /*bAdd=*/false);
+ // Also remove the whole signature sub-storage: release our read-write reference + remove the element.
+ aStreamHelper = SignatureStreamHelper();
+ mxStore->removeElement("_xmlsignatures");
}
for (size_t i = 0; i < nSignatureCount; ++i)
@@ -390,7 +393,7 @@ void DocumentSignatureManager::write()
}
// If stream was not provided, we are responsible for committing it....
- if (!mxSignatureStream.is())
+ if (!mxSignatureStream.is() && aStreamHelper.xSignatureStorage.is())
{
uno::Reference<embed::XTransactedObject> xTrans(aStreamHelper.xSignatureStorage, uno::UNO_QUERY);
xTrans->commit();