[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - dbaccess/source

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Fri May 1 15:50:01 UTC 2020


 dbaccess/source/core/dataaccess/ModelImpl.cxx |   20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 172d4990635d46355ac432b89ab520776909e48c
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Tue Mar 31 07:52:30 2020 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri May 1 17:49:29 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 <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit 6c89715b7d1e78a17b6c53cdb89f2f734500fd44)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93186
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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&)
     {


More information about the Libreoffice-commits mailing list