dbaccess/source/core/dataaccess/ModelImpl.cxx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
New commits: commit 1d09fd89b27cc037d6a89bfdeea76a3a1e83030a Author: Samuel Mehrbrodt <[email protected]> AuthorDate: Tue Mar 31 07:52:30 2020 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Wed Apr 8 23:50:07 2020 +0200 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 <[email protected]> (cherry picked from commit 6c89715b7d1e78a17b6c53cdb89f2f734500fd44) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91917 Tested-by: Thorsten Behrens <[email protected]> Reviewed-by: Thorsten Behrens <[email protected]> diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index a0cfd46f3c18..0e1934f364c6 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -42,6 +42,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 <comphelper/interaction.hxx> #include <comphelper/seqstream.hxx> @@ -55,6 +56,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/processfactory.hxx> #include <tools/debug.hxx> +#include <sfx2/docfile.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> #include <sal/log.hxx> @@ -1298,7 +1300,7 @@ SignatureState ODatabaseModelImpl::getScriptingSignatureState() return m_nScriptingSignatureState; } -bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool /*bAllowUIToAddAuthor*/) +bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor) { bool bResult = false; @@ -1337,6 +1339,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&) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
