diff options
author | Henry Castro <hcastro@collabora.com> | 2022-10-27 18:11:08 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2022-11-04 17:11:05 +0100 |
commit | d470c26d1635e7408e44fc76e584e244b87809ef (patch) | |
tree | 74c44510bab6f19ee49629475be1c620e60d9c73 | |
parent | 9257486636dfe95b73e5690462ba6e8408a12166 (diff) |
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 <hcastro@collabora.com>
Change-Id: I4ef82c1079888ae099084072c146b5db4cc0f2a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141950
Tested-by: Jenkins
Reviewed-by: Ashod Nakashian <ash@collabora.com>
(cherry picked from commit f43a5ec28d36422c105da3d640bf94ad9c8a2ba6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141926
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
-rw-r--r-- | desktop/source/lib/init.cxx | 3 | ||||
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 8 | ||||
-rw-r--r-- | include/unotools/mediadescriptor.hxx | 1 |
3 files changed, 11 insertions, 1 deletions
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"; |