summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-31 07:52:30 +0200
committerAndras Timar <andras.timar@collabora.com>2020-05-06 22:25:24 +0200
commit33859beccffc27035aadfbe99c1fce05899138b3 (patch)
treea4067af0c75b3830c7dc857194a5bb542b6426e6 /dbaccess
parent5bb6bafb2cb1fcb2aa314d2048cf25b9764cb32b (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/+/93186 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 2f156bc6f130..083609f5333c 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -41,6 +41,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 <connectivity/dbexception.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -51,6 +52,7 @@
#include <comphelper/types.hxx>
#include <rtl/digest.h>
#include <comphelper/processfactory.hxx>
+#include <sfx2/docfile.hxx>
#include <sfx2/signaturestate.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
@@ -1291,7 +1293,7 @@ SignatureState ODatabaseModelImpl::getScriptingSignatureState()
return m_nScriptingSignatureState;
}
-bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool /*bAllowUIToAddAuthor*/)
+bool ODatabaseModelImpl::hasTrustedScriptingSignature(bool bAllowUIToAddAuthor)
{
bool bResult = false;
@@ -1330,6 +1332,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&)
{