desktop/source/lib/lokinteractionhandler.cxx |   23 +++++++++++++++++++++++
 desktop/source/lib/lokinteractionhandler.hxx |    1 +
 sfx2/source/doc/objstor.cxx                  |    3 ++-
 3 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 3f754470815e0dc5ac169a480931282107aad0f9
Author:     merttumer <mert.tu...@collabora.com>
AuthorDate: Mon Apr 26 08:12:11 2021 +0300
Commit:     Mert Tumer <mert.tu...@collabora.com>
CommitDate: Mon Apr 26 14:17:05 2021 +0200

    lok: Interaction handler for FilterOptions
    
    This will enable Text Import Dialog to be executed
    before the document is loaded
    
    Change-Id: I263e69f0739f4971f4c4eec032ebf22ffbdeebb7
    Signed-off-by: merttumer <mert.tu...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114638
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 3ee9c891f6ea..ad480964616c 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -41,6 +41,8 @@
 #include <com/sun/star/task/DocumentPasswordRequest2.hpp>
 #include <com/sun/star/task/DocumentMSPasswordRequest2.hpp>
 
+#include <com/sun/star/document/FilterOptionsRequest.hpp>
+
 #include "../../inc/lib/init.hxx"
 
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
@@ -330,6 +332,24 @@ bool LOKInteractionHandler::handlePasswordRequest(const 
uno::Sequence<uno::Refer
     return true;
 }
 
+bool LOKInteractionHandler::handleFilterOptionsRequest(const 
uno::Reference<task::XInteractionRequest>& xRequest)
+{
+    document::FilterOptionsRequest aFilterOptionsRequest;
+    uno::Any const request(xRequest->getRequest());
+    if (request >>= aFilterOptionsRequest)
+    {
+        uno::Reference< task::XInteractionHandler2 > 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)
 {
@@ -345,6 +365,9 @@ sal_Bool SAL_CALL 
LOKInteractionHandler::handleInteractionRequest(
     if (handlePasswordRequest(rContinuations, request))
         return true;
 
+    if (handleFilterOptionsRequest(xRequest))
+        return true;
+
     task::DocumentMacroConfirmationRequest aConfirmRequest;
     if (request >>= aConfirmRequest)
     {
diff --git a/desktop/source/lib/lokinteractionhandler.hxx 
b/desktop/source/lib/lokinteractionhandler.hxx
index f6dc441327d8..dc827b33d78f 100644
--- a/desktop/source/lib/lokinteractionhandler.hxx
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -76,6 +76,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);
+    bool handleFilterOptionsRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
Request);
 
 public:
     void SetPassword(char const* pPassword);
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9e54c3771f92..0a2dd750dad7 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -874,7 +874,8 @@ ErrCode SfxObjectShell::HandleFilter( SfxMedium* pMedium, 
SfxObjectShell const *
     SfxItemSet* pSet = pMedium->GetItemSet();
     const SfxStringItem* pOptions = SfxItemSet::GetItem<SfxStringItem>(pSet, 
SID_FILE_FILTEROPTIONS, false);
     const SfxUnoAnyItem* pData = SfxItemSet::GetItem<SfxUnoAnyItem>(pSet, 
SID_FILTER_DATA, false);
-    if ( !pData && !pOptions )
+    const bool bTiledRendering = comphelper::LibreOfficeKit::isActive();
+    if ( !pData && (bTiledRendering || !pOptions) )
     {
         css::uno::Reference< XMultiServiceFactory > xServiceManager = 
::comphelper::getProcessServiceFactory();
         css::uno::Reference< XNameAccess > xFilterCFG;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to