diff options
author | Henry Castro <hcastro@collabora.com> | 2022-10-27 18:11:08 -0400 |
---|---|---|
committer | Gökay ŞATIR <gokaysatir@collabora.com> | 2022-10-31 13:29:39 +0100 |
commit | f43a5ec28d36422c105da3d640bf94ad9c8a2ba6 (patch) | |
tree | c0d86e75d583d93cbeab8dd21885050c608c15f1 | |
parent | 291783343073bb726ea0292ee6f0fa0cc09abc5b (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>
-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 b0ebc21138eb..46dbe3e5d9c6 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2596,7 +2596,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 b3f351a22cae..89feaa25d0ab 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 92728fa51972..8b4f9365acf9 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"; |