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

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Tue May 11 06:48:05 UTC 2021


 desktop/source/lib/lokinteractionhandler.cxx |   29 ++++++++++++++++-----------
 desktop/source/lib/lokinteractionhandler.hxx |    1 
 2 files changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 8630f4299e885640f16b644033a4964de5c4af2c
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon May 10 14:59:29 2021 +0900
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Tue May 11 08:47:30 2021 +0200

    lok: move handleMacroConfirmationRequest to its own method
    
    Just refactor to make it similar to other requests.
    
    Change-Id: I1a76d3d4ecc02b0a223ab8e44b11047455280142
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115302
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index ad480964616c..13b6361d6436 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -350,6 +350,23 @@ bool LOKInteractionHandler::handleFilterOptionsRequest(const uno::Reference<task
     return false;
 }
 
+bool LOKInteractionHandler::handleMacroConfirmationRequest(const uno::Reference<task::XInteractionRequest>& xRequest)
+{
+    uno::Any const request(xRequest->getRequest());
+
+    task::DocumentMacroConfirmationRequest aConfirmRequest;
+    if (request >>= aConfirmRequest)
+    {
+        auto xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(), nullptr));
+
+        if (xInteraction.is())
+            xInteraction->handleInteractionRequest(xRequest);
+
+        return true;
+    }
+    return false;
+}
+
 sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
         const uno::Reference<task::XInteractionRequest>& xRequest)
 {
@@ -368,18 +385,8 @@ sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(
     if (handleFilterOptionsRequest(xRequest))
         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);
-
+     if (handleMacroConfirmationRequest(xRequest))
         return true;
-    }
 
     // TODO: perform more interactions 'for real' like the above
     selectApproved(rContinuations);
diff --git a/desktop/source/lib/lokinteractionhandler.hxx b/desktop/source/lib/lokinteractionhandler.hxx
index dc827b33d78f..20396386518f 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -77,6 +77,7 @@ private:
     bool handleNetworkException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
     bool handlePasswordRequest(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
     bool handleFilterOptionsRequest(const ::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& Request);
+    bool handleMacroConfirmationRequest(const css::uno::Reference<css::task::XInteractionRequest>& xRequest);
 
 public:
     void SetPassword(char const* pPassword);


More information about the Libreoffice-commits mailing list