[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - framework/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Wed Jun 20 09:41:11 UTC 2018


 framework/source/loadenv/loadenv.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4ad153627120df1b962622085be0bd3673a23c8e
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Wed Jun 20 11:39:02 2018 +0200

    Don't load UI when running in unit tests
    
    There seems to be some exception for testFdo77229 that IsHeadlessModeEnabled
    returns false.
    So add another check here.
    
    Follow-up for c6dbeee59fa4fd8b43f3ae182c18bf04d57c52dc
    
    Change-Id: I023791bc9c8e1168abb943dc706c7fc8c17671b8

diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 4bb7b034c7c9..9a138b4d59f9 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -160,11 +160,11 @@ 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())
+        static bool const s_isTest(getenv("LO_TESTNAME") != nullptr);
+        if (aDescriptor.get("Hidden") == uno::Any(true) || Application::IsHeadlessModeEnabled() || s_isTest)
             loadEnvFeatures = E_NO_FEATURE;
 
         aEnv.initializeLoading(sURL,


More information about the Libreoffice-commits mailing list