[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 13 10:15:37 UTC 2021
desktop/source/lib/lokinteractionhandler.cxx | 29 ++++++++++++++++-----------
desktop/source/lib/lokinteractionhandler.hxx | 1
2 files changed, 19 insertions(+), 11 deletions(-)
New commits:
commit e49133a6fbe424ca7a5c635bbf089ec333baf3f5
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: Thu May 13 12:15:03 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/+/115306
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115533
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index 7561bb968dd4..eb7d120a5e3e 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -333,6 +333,23 @@ bool LOKInteractionHandler::handlePasswordRequest(const uno::Sequence<uno::Refer
return true;
}
+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)
{
@@ -348,18 +365,8 @@ 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);
-
+ 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 92bc2ffbac8e..9c15f85f4bc8 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -74,6 +74,7 @@ private:
bool handleIOException(const css::uno::Sequence<css::uno::Reference<css::task::XInteractionContinuation>> &rContinuations, const css::uno::Any& rRequest);
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);
+ static bool handleMacroConfirmationRequest(const css::uno::Reference<css::task::XInteractionRequest>& xRequest);
public:
void SetPassword(char const* pPassword);
More information about the Libreoffice-commits
mailing list