diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-06-25 14:32:11 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-06-25 15:41:03 +0200 |
commit | c3f8702241b625db994bcb059d8c91c25fd43e53 (patch) | |
tree | cce24d3abf7bb2b4d64b73d27d9840b00004a7a7 /xmlsecurity/source/helper/documentsignaturemanager.cxx | |
parent | 029a6f72f88612e21093f56939aaf5aefbeadeb1 (diff) |
sd signature line: pass the model down to xmlsecurity
So it can avoid SfxObjectShell::Current(), which is only correct when a
single document is open.
Also add an sfx2::DigitalSignatures interface so this can be done
without UNO API changes.
Change-Id: Ie81996b8f1e8851975b27c43a53f9d23e316004e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97116
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'xmlsecurity/source/helper/documentsignaturemanager.cxx')
-rw-r--r-- | xmlsecurity/source/helper/documentsignaturemanager.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 79d2cdf26b61..295522775951 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XWriter.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <comphelper/base64.hxx> #include <comphelper/storagehelper.hxx> @@ -359,7 +360,7 @@ bool DocumentSignatureManager::add( getPDFSignatureHelper().SetX509Certificate(xCert); getPDFSignatureHelper().SetDescription(rDescription); uno::Reference<io::XInputStream> xInputStream(mxSignatureStream, uno::UNO_QUERY); - if (!getPDFSignatureHelper().Sign(xInputStream, bAdESCompliant)) + if (!getPDFSignatureHelper().Sign(mxModel, xInputStream, bAdESCompliant)) { SAL_WARN("xmlsecurity.helper", "PDFSignatureHelper::Sign() failed"); return false; @@ -684,4 +685,9 @@ DocumentSignatureManager::getGpgSecurityContext() const return mxGpgSecurityContext; } +void DocumentSignatureManager::setModel(const uno::Reference<frame::XModel>& xModel) +{ + mxModel = xModel; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |