[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 19 13:14:10 UTC 2021


 desktop/source/lib/lokinteractionhandler.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 2683111a81c5eeca3e058f5f4f3cbc899c451993
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Fri Dec 25 13:40:33 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Jan 19 14:13:31 2021 +0100

    lok: add interaction handler "macro security" confirmation
    
    When a client side request to load document with macros
    embedded, it will show the "Macro Security Warning" message dialog.
    
    Change-Id: Id848980a4fd3a5138bc98c43e57044f7d5ce3189
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108292
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109150
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index cebfcb72f579..3ee9c891f6ea 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -22,11 +22,14 @@
 #include <boost/property_tree/json_parser.hpp>
 
 #include <rtl/ref.hxx>
+#include <comphelper/processfactory.hxx>
 #include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/task/XInteractionAbort.hpp>
 #include <com/sun/star/task/XInteractionApprove.hpp>
 #include <com/sun/star/task/XInteractionPassword2.hpp>
+#include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
 #include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp>
 #include <com/sun/star/ucb/InteractiveNetworkOffLineException.hpp>
 
@@ -342,6 +345,19 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
     if (handlePasswordRequest(rContinuations, request))
         return true;
 
+    task::DocumentMacroConfirmationRequest aConfirmRequest;
+    if (request >>= aConfirmRequest)
+    {
+        uno::Reference< task::XInteractionHandler2 > xInteraction(
+            task::InteractionHandler::createWithParent(
+                ::comphelper::getProcessComponentContext(), nullptr));
+
+        if (xInteraction.is())
+            xInteraction->handleInteractionRequest(xRequest);
+
+        return true;
+    }
+
     // TODO: perform more interactions 'for real' like the above
     selectApproved(rContinuations);
 


More information about the Libreoffice-commits mailing list