[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - framework/source
Samuel Mehrbrodt
Samuel.Mehrbrodt at cib.de
Tue Jun 19 12:46:48 UTC 2018
framework/source/loadenv/loadenv.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit c6dbeee59fa4fd8b43f3ae182c18bf04d57c52dc
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date: Tue Jun 19 11:47:08 2018 +0200
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
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 5961c57596ab..4bb7b034c7c9 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>
@@ -159,11 +160,19 @@ css::uno::Reference< css::lang::XComponent > LoadEnv::loadComponentFromURL(const
{
LoadEnv aEnv(xContext);
+
+ EFeature loadEnvFeatures = E_WORK_WITH_UI;
+ comphelper::NamedValueCollection aDescriptor( lArgs );
+ // tdf#118238 Only disable UI interaction when loading as hidden
+ if (aDescriptor.get("Hidden") == uno::Any(true) || Application::IsHeadlessModeEnabled())
+ loadEnvFeatures = E_NO_FEATURE;
+
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!
More information about the Libreoffice-commits
mailing list