Kaydet (Commit) 68e2dd0d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Make IsHeadlessModeRequested hack work for LOK

Change-Id: I30bf474fc44b122c8b7218e187c822a8784783fd
üst 7594c0c2
...@@ -740,6 +740,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) ...@@ -740,6 +740,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
// CommandLineArgs): // CommandLineArgs):
desktop::Desktop::GetCommandLineArgs().setHeadless(); desktop::Desktop::GetCommandLineArgs().setHeadless();
Application::EnableHeadlessMode(true);
// We could use InitVCL() here -- and used to before using soffice_main, // 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 // however that now deals with the initialisation for us (and it's not
// possible to try to set up VCL twice. // possible to try to set up VCL twice.
...@@ -773,8 +775,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath) ...@@ -773,8 +775,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
return false; return false;
} }
Application::EnableHeadlessMode(true);
ErrorHandler::RegisterDisplay(aBasicErrorFunc); ErrorHandler::RegisterDisplay(aBasicErrorFunc);
SAL_INFO("lok", "LOK Initialized"); SAL_INFO("lok", "LOK Initialized");
......
...@@ -43,6 +43,9 @@ namespace { ...@@ -43,6 +43,9 @@ namespace {
// Application::EnableHeadlessMode has potentially been called: // Application::EnableHeadlessMode has potentially been called:
bool IsHeadlessModeRequested() bool IsHeadlessModeRequested()
{ {
if (Application::IsHeadlessModeEnabled()) {
return true;
}
sal_uInt32 n = rtl_getAppCommandArgCount(); sal_uInt32 n = rtl_getAppCommandArgCount();
for (sal_uInt32 i = 0; i < n; ++i) { for (sal_uInt32 i = 0; i < n; ++i) {
OUString arg; OUString arg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment