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-07-07 17:42:30 +0200
commit01c64e1624258f1f3ebee9769b38e7b51fdcf99b (patch)
tree3aebc4ccac68e63110df6c05c3d169bc00eb89a3 /xmlsecurity
parent8720924f4e546860ffa9a9f6c0352f240a96ce04 (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 (cherry picked from commit e60abe659d7448ae6f839740dcfe87fd8b1520d7)
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();