desktop/source/lib/lokinteractionhandler.cxx |   24 ++++++++++++++++++++++++
 desktop/source/lib/lokinteractionhandler.hxx |    2 ++
 uui/source/iahndl-errorhandler.cxx           |    1 -
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 447d6af45b3c454bb858bc904f50e500aaaefc60
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Sep 6 10:28:59 2023 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Mon Oct 9 16:32:35 2023 +0200

    lok: implement "handleLoadReadOnlyRequest"
    
    Is used for interaction handle to query user decision
    regarding to open the document read only.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: Ia945eae7b1627d57d6211ae92a784d50313c2627
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156623
    Reviewed-by: Ashod Nakashian <a...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157703
    Tested-by: Jenkins

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 6df4fe2d98e5..a05091cedf5e 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -23,6 +23,7 @@
 #include <cppuhelper/supportsservice.hxx>
 
 #include <com/sun/star/document/BrokenPackageRequest.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/task/XInteractionAbort.hpp>
 #include <com/sun/star/task/XInteractionApprove.hpp>
 #include <com/sun/star/task/XInteractionPassword2.hpp>
@@ -368,6 +369,26 @@ bool 
LOKInteractionHandler::handlePackageReparationRequest(const uno::Reference<
     return false;
 }
 
+bool LOKInteractionHandler::handleLoadReadOnlyRequest(const 
uno::Reference<task::XInteractionRequest>& xRequest)
+{
+    uno::Any const request(xRequest->getRequest());
+
+    OUString aFileName;
+    beans::NamedValue aLoadReadOnlyRequest;
+    if ((request >>= aLoadReadOnlyRequest) &&
+        aLoadReadOnlyRequest.Name == "LoadReadOnlyRequest" &&
+        (aLoadReadOnlyRequest.Value >>= aFileName))
+    {
+        auto 
xInteraction(task::InteractionHandler::createWithParent(comphelper::getProcessComponentContext(),
 nullptr));
+
+        if (xInteraction.is())
+            xInteraction->handleInteractionRequest(xRequest);
+
+        return true;
+    }
+    return false;
+}
+
 bool LOKInteractionHandler::handleFilterOptionsRequest(const 
uno::Reference<task::XInteractionRequest>& xRequest)
 {
     document::FilterOptionsRequest aFilterOptionsRequest;
@@ -410,6 +431,9 @@ sal_Bool SAL_CALL 
LOKInteractionHandler::handleInteractionRequest(
     if (handlePackageReparationRequest(xRequest))
         return true;
 
+    if (handleLoadReadOnlyRequest(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 fc2bf12b48cc..c3641db0762f 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -79,6 +79,8 @@ private:
     static bool handleFilterOptionsRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
Request);
     static bool handlePackageReparationRequest(const 
css::uno::Reference<css::task::XInteractionRequest>& xRequest);
 
+    static bool handleLoadReadOnlyRequest(const 
css::uno::Reference<css::task::XInteractionRequest>& xRequest);
+
 public:
     void SetPassword(char const* pPassword);
 
diff --git a/uui/source/iahndl-errorhandler.cxx 
b/uui/source/iahndl-errorhandler.cxx
index c89e66b93c35..e4be8a713911 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -94,7 +94,6 @@ executeErrorDialog(
             break;
     }
 
-
     switch (nButtonMask)
     {
         case MessageBoxStyle::NONE:

Reply via email to