desktop/source/lib/init.cxx | 6 ++++++ include/vcl/svapp.hxx | 1 + vcl/source/window/dialog.cxx | 4 ++++ 3 files changed, 11 insertions(+)
New commits: commit 5f3fbb019bd79bd57eed94e01bd2202efd9a0c06 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Feb 17 16:47:27 2021 -0400 Commit: Jan Holesovsky <ke...@collabora.com> CommitDate: Mon Feb 22 16:01:51 2021 +0100 lok: add batch mode option to load the document When the LibreOffice Kit is active by default is set to headless mode, with the flag "DialogCancelMode::Silent", according to the documentation it should close the dialog, but it was changed for dialog tunneling. However the dialog tunneling is being deprecated, and in order to not produce any regression, it will be used temporary a new state "DialogCancelMode::LOKSilent", to disable any dialog interactivity. Change-Id: I3b6cce38c37f75dc1b24dda352f6caec19438ff1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111087 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Jan Holesovsky <ke...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index e72f17e8c45a..621e2f3455f8 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2249,6 +2249,12 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, const OUString aDeviceFormFactor = extractParameter(aOptions, "DeviceFormFactor"); SfxLokHelper::setDeviceFormFactor(aDeviceFormFactor); + const OUString aBatch = extractParameter(aOptions, "Batch"); + if (!aBatch.isEmpty()) + { + Application::SetDialogCancelMode(DialogCancelMode::LOKSilent); + } + uno::Sequence<css::beans::PropertyValue> aFilterOptions(3); aFilterOptions[0] = css::beans::PropertyValue( "FilterOptions", 0, diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d0c1e7f0bb6e..a0a5b53144c2 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -220,6 +220,7 @@ private: enum class DialogCancelMode { Off, ///< do not automatically cancel dialogs Silent, ///< silently cancel any dialogs + LOKSilent, ///< silently cancel any dialogs (LOK case) Fatal ///< cancel any dialogs by std::abort }; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index d4437116b725..83fa562023ce 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -947,6 +947,10 @@ bool Dialog::ImplStartExecute() "Dialog \"" << ImplGetDialogText(this) << "\"cancelled in silent mode"); return false; + + case DialogCancelMode::LOKSilent: + return false; + default: // default cannot happen case DialogCancelMode::Fatal: std::abort(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits