[Libreoffice-commits] core.git: cli_ure/source desktop/source sal/osl vcl/generic

Stephan Bergmann sbergman at redhat.com
Fri Dec 12 00:29:41 PST 2014


 cli_ure/source/climaker/climaker_app.cxx |    6 ---
 desktop/source/app/app.cxx               |    2 -
 desktop/source/splash/unxsplash.cxx      |    3 -
 sal/osl/unx/signal.cxx                   |   62 ++++++++++++++-----------------
 sal/osl/w32/profile.cxx                  |    5 +-
 vcl/generic/app/gensys.cxx               |    6 +--
 6 files changed, 37 insertions(+), 47 deletions(-)

New commits:
commit df46ec0580b625efe8bd747bed54bc4d4d71f073
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 12 09:28:47 2014 +0100

    osl_getCommandArg always returns osl_Process_E_None
    
    Change-Id: I0ff1e44f17976fd3a3060d8ee7fe15d77c918b79

diff --git a/cli_ure/source/climaker/climaker_app.cxx b/cli_ure/source/climaker/climaker_app.cxx
index c39f4b9..7d5b808 100644
--- a/cli_ure/source/climaker/climaker_app.cxx
+++ b/cli_ure/source/climaker/climaker_app.cxx
@@ -344,11 +344,7 @@ SAL_IMPLEMENT_MAIN()
                      !read_argument( &keyfile, info_keyfile, &nPos ) &&
                      !read_argument( &delaySign, info_delaySign, &nPos ))
             {
-                if ( osl_getCommandArg( nPos, &cmd_arg.pData ) !=
-                     osl_Process_E_None )
-                {
-                    OSL_ASSERT( false );
-                }
+                osl_getCommandArg( nPos, &cmd_arg.pData );
                 ++nPos;
                 cmd_arg = cmd_arg.trim();
                 if (cmd_arg.getLength() > 0)
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index e22f0a4..e5f0a84 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1152,7 +1152,7 @@ void restartOnMac(bool passArguments) {
         sal_uInt32 n = osl_getCommandArgCount();
         for (sal_uInt32 i = 0; i < n; ++i) {
             OUString arg;
-            OSL_VERIFY(osl_getCommandArg(i, &arg.pData) == osl_Process_E_None);
+            osl_getCommandArg(i, &arg.pData);
             if (arg.match("--accept=")) {
                 wait = true;
             }
diff --git a/desktop/source/splash/unxsplash.cxx b/desktop/source/splash/unxsplash.cxx
index 0673286..9f34c41 100644
--- a/desktop/source/splash/unxsplash.cxx
+++ b/desktop/source/splash/unxsplash.cxx
@@ -103,8 +103,7 @@ UnxSplashScreen::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::
     for ( sal_uInt32 i = 0; i < osl_getCommandArgCount(); i++ )
     {
         OUString aArg;
-        if ( osl_getCommandArg( i, &aArg.pData ) )
-            break;
+        osl_getCommandArg( i, &aArg.pData );
         if ( aArg.matchIgnoreAsciiCaseAsciiL( PIPE_ARG, sizeof( PIPE_ARG ) - 1, 0 ) )
         {
             OUString aNum = aArg.copy( sizeof( PIPE_ARG ) - 1 );
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index c97162b..d5098a2 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -494,46 +494,42 @@ static int ReportCrash( int Signal )
 
     for ( argi = 0; argi < argc; argi++ )
     {
-        if ( osl_Process_E_None == osl_getCommandArg( argi, &ustrCommandArg ) )
+        osl_getCommandArg( argi, &ustrCommandArg );
+        if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--nocrashreport" ) )
         {
-            if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--nocrashreport" ) )
-            {
-                rtl_uString_release( ustrCommandArg );
-                return -1;
-            }
-            else if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--autocrashreport" ) )
-            {
-                bAutoCrashReport = true;
-            }
-            else if ( 0 == rtl_ustr_ascii_shortenedCompare_WithLength(
-                rtl_uString_getStr( ustrCommandArg ), rtl_uString_getLength( ustrCommandArg ),
-                REPORTENV_PARAM, strlen(REPORTENV_PARAM) )
-                )
-            {
-                rtl_uString *ustrEnvironment = NULL;
-                rtl_String *strEnv = NULL;
-
-                rtl_uString_newFromStr( &ustrEnvironment, rtl_uString_getStr( ustrCommandArg ) + strlen(REPORTENV_PARAM) );
+            rtl_uString_release( ustrCommandArg );
+            return -1;
+        }
+        else if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--autocrashreport" ) )
+        {
+            bAutoCrashReport = true;
+        }
+        else if ( 0 == rtl_ustr_ascii_shortenedCompare_WithLength(
+            rtl_uString_getStr( ustrCommandArg ), rtl_uString_getLength( ustrCommandArg ),
+            REPORTENV_PARAM, strlen(REPORTENV_PARAM) )
+            )
+        {
+            rtl_uString *ustrEnvironment = NULL;
+            rtl_String *strEnv = NULL;
 
-                if ( ustrEnvironment )
-                {
-                    rtl_uString2String(
-                        &strEnv,
-                        rtl_uString_getStr( ustrEnvironment ), rtl_uString_getLength( ustrEnvironment ),
-                        osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS
-                        );
+            rtl_uString_newFromStr( &ustrEnvironment, rtl_uString_getStr( ustrCommandArg ) + strlen(REPORTENV_PARAM) );
 
-                    if ( strEnv )
-                    {
-                        putenv( rtl_string_getStr( strEnv ) );
-                        rtl_string_release( strEnv );
-                    }
+            if ( ustrEnvironment )
+            {
+                rtl_uString2String(
+                    &strEnv,
+                    rtl_uString_getStr( ustrEnvironment ), rtl_uString_getLength( ustrEnvironment ),
+                    osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS
+                    );
 
-                    rtl_uString_release( ustrEnvironment );
+                if ( strEnv )
+                {
+                    putenv( rtl_string_getStr( strEnv ) );
+                    rtl_string_release( strEnv );
                 }
 
+                rtl_uString_release( ustrEnvironment );
             }
-
         }
     }
 
diff --git a/sal/osl/w32/profile.cxx b/sal/osl/w32/profile.cxx
index 1a0de62..43db47f 100644
--- a/sal/osl/w32/profile.cxx
+++ b/sal/osl/w32/profile.cxx
@@ -2204,9 +2204,8 @@ static sal_Bool lookupProfile(const sal_Unicode *strPath, const sal_Unicode *str
         for (n = 0; n < nArgs; n++)
         {
             rtl_uString * strCommandArg = NULL;
-
-            if ((osl_getCommandArg( n, &strCommandArg ) == osl_Process_E_None) &&
-                ((strCommandArg->buffer[0] == L'-') || (strCommandArg->buffer[0] == L'+')) &&
+            osl_getCommandArg( n, &strCommandArg );
+            if (((strCommandArg->buffer[0] == L'-') || (strCommandArg->buffer[0] == L'+')) &&
                 (rtl_ustr_ascii_compare_WithLength(strCommandArg->buffer, RTL_CONSTASCII_LENGTH(SVERSION_OPTION), SVERSION_OPTION)))
             {
                 sal_Unicode *pCommandArg = strCommandArg->buffer + RTL_CONSTASCII_LENGTH(SVERSION_OPTION);
diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx
index 0c67e6c..9eda402 100644
--- a/vcl/generic/app/gensys.cxx
+++ b/vcl/generic/app/gensys.cxx
@@ -167,10 +167,10 @@ const char* SalGenericSystem::getFrameResName()
         for( int n = 0; n < nArgs-1; n++ )
         {
             OUString aArg;
-            if( ! osl_getCommandArg( n, &aArg.pData ) &&
-                aArg.equalsIgnoreAsciiCase("-name") &&
-                ! osl_getCommandArg( n+1, &aArg.pData ) )
+            osl_getCommandArg( n, &aArg.pData );
+            if( aArg.equalsIgnoreAsciiCase("-name") )
             {
+                osl_getCommandArg( n+1, &aArg.pData );
                 aResName.append( OUStringToOString( aArg, osl_getThreadTextEncoding() ) );
                 break;
             }


More information about the Libreoffice-commits mailing list