diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-04 16:59:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-02-04 17:18:10 +0100 |
commit | 8f2f125802f5932ed3be598a768267ebcd413e49 (patch) | |
tree | deaee3db3faecda52fbf42f1a27e153c2d510d84 /xmlsecurity/source/dialogs | |
parent | f065747552379bc3bf56fd479a04fd3de1ef72b7 (diff) |
xmlsecurity: don't write the stream of an OOXML storage
We'll need individual streams instead for OOXML.
Change-Id: Ia3a7172af39ebfb815d44b645b217da15e41c197
Diffstat (limited to 'xmlsecurity/source/dialogs')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index be0b412d45b2..6601bbe6ec5e 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -492,22 +492,26 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, AddButtonHdl, Button*, void) //a sax writer are used to write the information. SignatureStreamHelper aStreamHelper = ImplOpenSignatureStream( css::embed::ElementModes::WRITE|css::embed::ElementModes::TRUNCATE, true); - Reference< css::io::XOutputStream > xOutputStream( - aStreamHelper.xSignatureStream, UNO_QUERY_THROW); - Reference< css::xml::sax::XWriter> xSaxWriter = - maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); - // Export old signatures... - uno::Reference< xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, UNO_QUERY_THROW); - size_t nInfos = maCurrentSignatureInformations.size(); - for ( size_t n = 0; n < nInfos; n++ ) - XMLSignatureHelper::ExportSignature( xDocumentHandler, maCurrentSignatureInformations[n]); - - // Create a new one... - maSignatureHelper.CreateAndWriteSignature( xDocumentHandler ); - - // That's it... - XMLSignatureHelper::CloseDocumentHandler( xDocumentHandler); + if (aStreamHelper.nStorageFormat != embed::StorageFormats::OFOPXML) + { + Reference< css::io::XOutputStream > xOutputStream( + aStreamHelper.xSignatureStream, UNO_QUERY_THROW); + Reference< css::xml::sax::XWriter> xSaxWriter = + maSignatureHelper.CreateDocumentHandlerWithHeader( xOutputStream ); + + // Export old signatures... + uno::Reference< xml::sax::XDocumentHandler> xDocumentHandler(xSaxWriter, UNO_QUERY_THROW); + size_t nInfos = maCurrentSignatureInformations.size(); + for ( size_t n = 0; n < nInfos; n++ ) + XMLSignatureHelper::ExportSignature( xDocumentHandler, maCurrentSignatureInformations[n]); + + // Create a new one... + maSignatureHelper.CreateAndWriteSignature( xDocumentHandler ); + + // That's it... + XMLSignatureHelper::CloseDocumentHandler( xDocumentHandler); + } maSignatureHelper.EndMission(); |