summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-31 07:52:30 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-04-08 23:50:07 +0200
commit1d09fd89b27cc037d6a89bfdeea76a3a1e83030a (patch)
treed06ac3b15c56337c0701259d16bd99f03fd28b46 /dbaccess
parentf87d2d7c3ba0f566fc129865543924ef5401916c (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> (cherry picked from commit 6c89715b7d1e78a17b6c53cdb89f2f734500fd44) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91917 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx20
1 files changed, 19 insertions, 1 deletions
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&)
{