diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-05-10 14:59:29 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-05-11 02:20:09 +0200 |
commit | 7aacb991f4777e9bcb5bf70a9259887d8dc6d8da (patch) | |
tree | 8345b8a639668da55e3cbe05c26baa33a1036013 /desktop | |
parent | d7f734db2c078ced3ce08ad58cd816a79abe3bcf (diff) |
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@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.cxx | 29 | ||||
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.hxx | 1 |
2 files changed, 19 insertions, 11 deletions
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); |