diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-05-10 14:59:29 +0900 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-05-12 10:51:51 +0200 |
commit | ebd6569f7556b0ffb0f10a888416ff10150975a7 (patch) | |
tree | 3984beb975cf3f177cd395247c331df48065d0fd /desktop | |
parent | 50db297b8e44babb9c3579eca93e710d6c988bc8 (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/+/115302
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
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 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); |