diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-12-06 20:27:29 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-12-06 20:28:56 +0100 |
commit | 2a9c1d1a75b7d4e79dfbc6be3dada1a1e959e58e (patch) | |
tree | a1f99c2b4ab4806bc117d8552fbd2e8472bf4e90 /vcl/unx | |
parent | f547b2c4788439380c3202407c251153be0c5b8e (diff) |
Make dialogs fail with an exception in headless tests.
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index 601ccafedd26..1e4636ee69a8 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -33,10 +33,11 @@ #include <X11/Xatom.h> #include <tools/postx.h> +#include "rtl/process.h" #include "rtl/ustrbuf.hxx" #include "osl/module.h" -#include "osl/process.h" #include "osl/thread.h" +#include "vcl/svapp.hxx" #include "vclpluginapi.h" @@ -251,22 +252,17 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() const char* pUsePlugin = getenv( "SAL_USE_VCLPLUGIN" ); - if (pUsePlugin && (strcmp(pUsePlugin, "svp") == 0)) + if ((pUsePlugin && (strcmp(pUsePlugin, "svp") == 0)) + || Application::IsHeadlessModeRequested()) pDisplayStr = NULL; else { - int nParams = osl_getCommandArgCount(); + int nParams = rtl_getAppCommandArgCount(); OUString aParam; OString aBParm; for( int i = 0; i < nParams; i++ ) { - osl_getCommandArg( i, &aParam.pData ); - if( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-headless" ) ) || - aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--headless" ) ) ) - { - pDisplayStr = NULL; - break; - } + rtl_getAppCommandArg( i, &aParam.pData ); if( i < nParams-1 && (aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-display" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--display" ) )) ) { osl_getCommandArg( i+1, &aParam.pData ); |