diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-06-19 11:47:08 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-22 13:29:26 +0200 |
commit | e873ce870c8d81c842ca5f211e07e42a51fb7cbf (patch) | |
tree | e47f7d0a37d709132a019695595a015590cc2e84 /framework/source | |
parent | 8a66650dccb94b6e79a345a383f6a7f955bfa600 (diff) |
tdf#118238 Only disable UI interaction when loading document as hidden
The "quiet" interaction handler was used unconditionally
when loading a document via the loadComponentFromURL API method.
So no dialog was shown asking the user whether he wants to enable macros.
With this patch, the "quiet" interaction handler is only used,
when the document was loaded with the "Hidden" property set.
Change-Id: Idd522d0bf605499b071390fb58312181b755dfca
Reviewed-on: https://gerrit.libreoffice.org/56086
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 1115a60e6d825c049680e7f2caf318e36d481b12)
Reviewed-on: https://gerrit.libreoffice.org/56094
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/loadenv/loadenv.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 4703d1cf5161..b527d0259e77 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -28,6 +28,7 @@ #include <services.h> #include <comphelper/interaction.hxx> #include <comphelper/lok.hxx> +#include <comphelper/namedvaluecollection.hxx> #include <comphelper/propertysequence.hxx> #include <framework/interaction.hxx> #include <comphelper/processfactory.hxx> @@ -152,11 +153,18 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const { LoadEnv aEnv(xContext); + LoadEnvFeatures loadEnvFeatures = LoadEnvFeatures::WorkWithUI; + comphelper::NamedValueCollection aDescriptor( lArgs ); + // tdf#118238 Only disable UI interaction when loading as hidden + if (aDescriptor.get("Hidden") == uno::Any(true) || Application::IsHeadlessModeEnabled()) + loadEnvFeatures = LoadEnvFeatures::NONE; + aEnv.initializeLoading(sURL, lArgs, css::uno::Reference< css::frame::XFrame >(xLoader, css::uno::UNO_QUERY), sTarget, - nFlags); + nFlags, + loadEnvFeatures); aEnv.startLoading(); aEnv.waitWhileLoading(); // wait for ever! |