diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 5a410e47e2b8..282cb9917881 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -740,6 +740,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) // CommandLineArgs): desktop::Desktop::GetCommandLineArgs().setHeadless(); + Application::EnableHeadlessMode(true); + // We could use InitVCL() here -- and used to before using soffice_main, // however that now deals with the initialisation for us (and it's not // possible to try to set up VCL twice. @@ -773,8 +775,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) return false; } - Application::EnableHeadlessMode(true); - ErrorHandler::RegisterDisplay(aBasicErrorFunc); SAL_INFO("lok", "LOK Initialized"); diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index e2870f39a8bd..80b5acf44722 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -43,6 +43,9 @@ namespace { // Application::EnableHeadlessMode has potentially been called: bool IsHeadlessModeRequested() { + if (Application::IsHeadlessModeEnabled()) { + return true; + } sal_uInt32 n = rtl_getAppCommandArgCount(); for (sal_uInt32 i = 0; i < n; ++i) { OUString arg; |