summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej.hunt@collabora.com>2014-07-10 12:19:36 +0200
committerMichael Meeks <michael.meeks@collabora.com>2014-07-11 11:43:49 +0100
commit390f842de17755fc5f67b60fc638324b33aa1d96 (patch)
treed3583eca3e17b66bfdd16e2e4efbbf4608e0e775 /desktop
parent972c92c84e6f95e8fa8818794280a16e681e5edd (diff)
Check whether Command Args are already set up before doing so.
Could already be set up e.g. if a client application is using UNO separately, in addition to LOK. Change-Id: I50c3230b6f2456360273902a308c303576baac10
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 88d618cd288e..273446f1f142 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -577,7 +577,14 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath)
try
{
- osl_setCommandArgs(0, NULL);
+ // 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);
+ }
initialize_uno(aAppURL);
force_c_locale();