desktop/source/lib/init.cxx          |    3 ++-
 framework/source/loadenv/loadenv.cxx |    8 ++++++++
 include/unotools/mediadescriptor.hxx |    1 +
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit d470c26d1635e7408e44fc76e584e244b87809ef
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Oct 27 18:11:08 2022 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Fri Nov 4 17:11:05 2022 +0100

    lok: fix convert-to batch mode, quiet interaction
    
    If it is a batch mode to convert *.csv to *.ods,
    use the quiet interaction to avoid unwanted filter dialogs.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I4ef82c1079888ae099084072c146b5db4cc0f2a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141950
    Tested-by: Jenkins
    Reviewed-by: Ashod Nakashian <a...@collabora.com>
    (cherry picked from commit f43a5ec28d36422c105da3d640bf94ad9c8a2ba6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141926
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 94dd41b738bb..7f35cb6a4918 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2634,7 +2634,8 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
             comphelper::makePropertyValue("FilterOptions", sFilterOptions),
             comphelper::makePropertyValue("InteractionHandler", xInteraction),
             comphelper::makePropertyValue("MacroExecutionMode", 
nMacroExecMode),
-            comphelper::makePropertyValue("AsTemplate", false)
+            comphelper::makePropertyValue("AsTemplate", false),
+            comphelper::makePropertyValue("Silent", !aBatch.isEmpty())
         };
 
         /* TODO
diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 45cc86ad582e..70eab302026a 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -295,6 +295,14 @@ void LoadEnv::startLoading(const OUString& sURL, const 
uno::Sequence<beans::Prop
         
!m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_HIDDEN,
 false) &&
         
!m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_PREVIEW,
 false);
 
+    if( comphelper::LibreOfficeKit::isActive() &&
+        
m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_SILENT, 
false))
+    {
+        rtl::Reference<QuietInteraction> pQuietInteraction = new 
QuietInteraction();
+        uno::Reference<task::XInteractionHandler> 
xInteractionHandler(pQuietInteraction);
+        m_lMediaDescriptor[utl::MediaDescriptor::PROP_INTERACTIONHANDLER] <<= 
xInteractionHandler;
+    }
+
     initializeUIDefaults(m_xContext, m_lMediaDescriptor, bUIMode, 
&m_pQuietInteraction);
 
     start();
diff --git a/include/unotools/mediadescriptor.hxx 
b/include/unotools/mediadescriptor.hxx
index 1e4b3c064d1c..9b9a5632ae77 100644
--- a/include/unotools/mediadescriptor.hxx
+++ b/include/unotools/mediadescriptor.hxx
@@ -86,6 +86,7 @@ class UNOTOOLS_DLLPUBLIC MediaDescriptor : public 
comphelper::SequenceAsHashMap
         static constexpr OUStringLiteral PROP_REFERRER = u"Referer";
         static constexpr OUStringLiteral PROP_REPLACEABLE = u"Replaceable";
         static constexpr OUStringLiteral PROP_SALVAGEDFILE = u"SalvagedFile";
+        static constexpr OUStringLiteral PROP_SILENT = u"Silent";
         static constexpr OUStringLiteral PROP_STATUSINDICATOR = 
u"StatusIndicator";
         static constexpr OUStringLiteral PROP_STREAM = u"Stream";
         static constexpr OUStringLiteral PROP_STREAMFOROUTPUT = 
u"StreamForOutput";

Reply via email to