[Libreoffice-commits] core.git: desktop/source

Andrzej Hunt andrzej.hunt at collabora.com
Fri Jul 11 03:42:22 PDT 2014


 desktop/source/lib/init.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 390f842de17755fc5f67b60fc638324b33aa1d96
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date:   Thu Jul 10 12:19:36 2014 +0200

    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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 88d618c..273446f1 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();
 


More information about the Libreoffice-commits mailing list