[Libreoffice-commits] core.git: vcl/unx

Stephan Bergmann sbergman at redhat.com
Thu Oct 17 08:39:48 PDT 2013


 vcl/unx/generic/desktopdetect/desktopdetector.cxx |    7 ++++---
 vcl/unx/generic/plugadapt/salplug.cxx             |    6 +-----
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 63691a62c8695889144841abf8a32d52535ae671
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Oct 17 17:33:10 2013 +0200

    Consistently use SAL_USE_VCLPLUGIN as a bootstrap variable
    
    ...and neither exclusively nor additionally as an environment variable (where
    bootstrap variables include environment variables, see the @file comment in
    include/rtl/bootstrap.h).  Note that LibLibreOffice_Impl::initialize
    (desktop/source/lib/init.cxx) sets it as a bootstrap, not as an environment
    variable.  (Though desktop/unx/source/start.c still only reads it as an
    environment variable; could potentially check argv for
    -env:SAL_USE_VCLPLUGIN=...)
    
    Change-Id: I9315f585cdb4f0783181359e030686167c4e4625

diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
index 6edf8d1..f18bf0a 100644
--- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx
+++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx
@@ -24,6 +24,7 @@
 
 #include <unx/desktops.hxx>
 
+#include "rtl/bootstrap.hxx"
 #include "rtl/process.h"
 #include "rtl/ustrbuf.hxx"
 #include "osl/module.h"
@@ -303,10 +304,10 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment()
     // get display to connect to
     const char* pDisplayStr = getenv( "DISPLAY" );
 
-    const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" );
+    OUString plugin;
+    rtl::Bootstrap::get("SAL_USE_VCLPLUGIN", plugin);
 
-    if ((pUsePlugin && (strcmp(pUsePlugin, "svp") == 0))
-        || Application::IsHeadlessModeRequested())
+    if (plugin == "svp" || Application::IsHeadlessModeRequested())
         pDisplayStr = NULL;
     else
     {
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index 1e0b0db..ddd0422 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -220,11 +220,7 @@ SalInstance *CreateSalInstance()
         aUsePlugin = "svp";
     else
     {
-        static const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" );
-        if( pUsePlugin )
-            aUsePlugin = OUString::createFromAscii( pUsePlugin );
-        else
-            rtl::Bootstrap::get( "SAL_USE_VCLPLUGIN", aUsePlugin );
+        rtl::Bootstrap::get( "SAL_USE_VCLPLUGIN", aUsePlugin );
     }
 
     if( !aUsePlugin.isEmpty() )


More information about the Libreoffice-commits mailing list