[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - framework/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Fri Jun 22 11:29:50 UTC 2018


 framework/source/loadenv/loadenv.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit e873ce870c8d81c842ca5f211e07e42a51fb7cbf
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
    Reviewed-on: https://gerrit.libreoffice.org/56086
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 1115a60e6d825c049680e7f2caf318e36d481b12)
    Reviewed-on: https://gerrit.libreoffice.org/56094
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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!
 


More information about the Libreoffice-commits mailing list