diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-07 11:10:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-03-07 15:00:14 +0100 |
commit | e60abe659d7448ae6f839740dcfe87fd8b1520d7 (patch) | |
tree | 6df14d158b71fa27f09ce4c82ddccbd1e524c3e7 | |
parent | xmlsecurity OOXML export: remove signature relation with the last signature (diff) | |
download | core-e60abe659d7448ae6f839740dcfe87fd8b1520d7.tar.gz core-e60abe659d7448ae6f839740dcfe87fd8b1520d7.zip |
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
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturemanager.cxx | 5 |
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(); |