summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2020-12-25 13:40:33 -0400
committerHenry Castro <hcastro@collabora.com>2021-01-05 16:11:11 +0100
commit007a57b663dca527f3e94bb53c2886e9bb43ccb6 (patch)
treef6c4bd92188b4055be2edad8d32cd2d2d2237b54 /desktop
parent88dc324436af556515317662822eaf5c2c34fd26 (diff)
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@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/lokinteractionhandler.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index 0933e4c230a7..7561bb968dd4 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -21,11 +21,14 @@
#include <boost/property_tree/json_parser.hpp>
+#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>
@@ -345,6 +348,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);