diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-03-31 07:52:30 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2020-03-31 09:06:44 +0200 |
commit | 6c89715b7d1e78a17b6c53cdb89f2f734500fd44 (patch) | |
tree | 51f8c0f826b5092a4ec4425af188bedd43fd24f2 /dbaccess | |
parent | c0f4bdcc7ca45e2920c676e5734353ba598bcdbc (diff) |
Related tdf#97694 Show dialog when signed macros are blocked
Change-Id: I7b9dd4872a58eff93ab8818f0286781c6ff4c9bd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91385
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/ModelImpl.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 137613f74f96..35e6215163d6 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/util/NumberFormatsSupplier.hpp> #include <com/sun/star/security/DocumentDigitalSignatures.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp> +#include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase.hxx> @@ -45,6 +46,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/types.hxx> #include <comphelper/processfactory.hxx> +#include <sfx2/docfile.hxx> #include <sfx2/signaturestate.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> @@ -1281,7 +1283,7 @@ SignatureState ODatabaseModelImpl::getScriptingSignatureState() return m_nScriptingSignatureState; } -bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool /*bAllowUIToAddAuthor*/) +bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor) { bool bResult = false; @@ -1320,6 +1322,22 @@ bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool /*bAllowUIToAddAuthor return xSigner->isAuthorTrusted(rInfo.Signer); }); } + + if (!bResult && bAllowUIToAddAuthor) + { + Reference<XInteractionHandler> xInteraction; + xInteraction = m_aMediaDescriptor.getOrDefault("InteractionHandler", xInteraction); + if (xInteraction.is()) + { + task::DocumentMacroConfirmationRequest aRequest; + aRequest.DocumentURL = m_sDocFileLocation; + aRequest.DocumentStorage = xStorage; + aRequest.DocumentSignatureInformation = aInfo; + aRequest.DocumentVersion = aVersion; + aRequest.Classification = task::InteractionClassification_QUERY; + bResult = SfxMedium::CallApproveHandler(xInteraction, uno::makeAny(aRequest), true); + } + } } catch (uno::Exception&) { |