Kaydet (Commit) 1115a60e authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt Kaydeden (comit) Stephan Bergmann

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: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 3b6905e3
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <services.h> #include <services.h>
#include <comphelper/interaction.hxx> #include <comphelper/interaction.hxx>
#include <comphelper/lok.hxx> #include <comphelper/lok.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/propertysequence.hxx> #include <comphelper/propertysequence.hxx>
#include <framework/interaction.hxx> #include <framework/interaction.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -152,11 +153,18 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const ...@@ -152,11 +153,18 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const
{ {
LoadEnv aEnv(xContext); 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, aEnv.initializeLoading(sURL,
lArgs, lArgs,
css::uno::Reference< css::frame::XFrame >(xLoader, css::uno::UNO_QUERY), css::uno::Reference< css::frame::XFrame >(xLoader, css::uno::UNO_QUERY),
sTarget, sTarget,
nFlags); nFlags,
loadEnvFeatures);
aEnv.startLoading(); aEnv.startLoading();
aEnv.waitWhileLoading(); // wait for ever! aEnv.waitWhileLoading(); // wait for ever!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment