summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-25 21:03:19 +0200
committerAndrzej Hunt <andrzej@ahunt.org>2014-08-19 14:06:24 +0200
commitd0b2b26c944c89a59a3842b50f300a5c19c5c305 (patch)
tree3be78e7762d0dd5f5cd70ca6c5f88fe71e3edbc8
parentd65508ad56e44f2c7f39273a544dfe54d1d830b0 (diff)
Make sure LOK is actually headless.
This prevents e.g. the document recovery dialog from trying to be shown. Change-Id: I253720f7fa1abd1c053670434f8394473517b670
-rw-r--r--desktop/source/lib/init.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 965dc8f204ed..4d94436e41ca 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -682,13 +682,24 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
try
{
+ // We specifically need to make sure we have the "headless"
+ // command arg set (various code specifically checks via
+ // CommandLineArgs). We could alternatively add some other
+ // flag elsewhere to indicate headlessness, which would
+ // then be set from here or via CommandLineArgs.
+ // (The first argument is treated specially by osl_setCommandArgs
+ // however it is valid to make it \0 instead.)
+ char sName[] = "";
+ char sHeadless[] = "--headless";
+ char* pArgs[2] = { sName, sHeadless };
+
// If we've set up the command args elsewhere then we cannot do it
// again (as an assert will fire), this will be the case e.g.
// for unit tests (and possibly if UNO is being used in addition
// to LOK in an external program).
if (!osl_areCommandArgsSet())
{
- osl_setCommandArgs(0, NULL);
+ osl_setCommandArgs(2, pArgs);
}
initialize_uno(aAppURL);
force_c_locale();