aa2be9c
From db21197de4383f75718190072171adab15e64a00 Mon Sep 17 00:00:00 2001
aa2be9c
From: Michael Stahl <mstahl@redhat.com>
aa2be9c
Date: Thu, 8 Mar 2012 15:49:52 +0100
aa2be9c
Subject: [PATCH] desktop: do not complain about soffice command line options:
aa2be9c
aa2be9c
These are handled in the soffice wrapper script, but that is too stupid
aa2be9c
to be able to filter these out, so just ignore them in soffice.bin.
aa2be9c
aa2be9c
(regression from 4efbd87e31e7488dfcdd1d07ff979f1f59b8b1f1)
aa2be9c
aa2be9c
Also, print errors on stderr.
aa2be9c
---
aa2be9c
 desktop/source/app/cmdlineargs.cxx |   10 ++++++++--
aa2be9c
 1 files changed, 8 insertions(+), 2 deletions(-)
aa2be9c
aa2be9c
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx
aa2be9c
index 5ae86ab..0bc6312 100644
aa2be9c
--- a/desktop/source/app/cmdlineargs.cxx
aa2be9c
+++ b/desktop/source/app/cmdlineargs.cxx
aa2be9c
@@ -306,10 +306,17 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& supplier )
aa2be9c
                     }
aa2be9c
 #if defined UNX
aa2be9c
                     else
aa2be9c
+                    // because it's impossible to filter these options that
aa2be9c
+                    // are handled in the soffice shell script with the
aa2be9c
+                    // primitive tools that /bin/sh offers, ignore them here
aa2be9c
+                    if (!oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("backtrace")) &&
aa2be9c
+                        !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("strace")) &&
aa2be9c
+                        !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("nocrashreport")) &&
aa2be9c
+                        !oArg.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("valgrind")))
aa2be9c
                     {
aa2be9c
-                        printf("Unknown option %s\n",
aa2be9c
+                        fprintf(stderr, "Unknown option %s\n",
aa2be9c
                             rtl::OUStringToOString(aArg, osl_getThreadTextEncoding()).getStr());
aa2be9c
-                        printf("Run 'soffice --help' to see a full list of available command line options.\n");
aa2be9c
+                        fprintf(stderr, "Run 'soffice --help' to see a full list of available command line options.\n");
aa2be9c
                         SetBoolParam_Impl( CMD_BOOLPARAM_UNKNOWN, sal_True );
aa2be9c
                     }
aa2be9c
 #endif
aa2be9c
-- 
aa2be9c
1.7.7.6
aa2be9c